teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2021/05/11 11:47

投稿

episteme
episteme

スコア16612

answer CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  struct kozotai* constructor() {
9
9
  typedef struct kozotai Queue;
10
- return (Queue*)malloc(sizeof(Queue));
10
+ Queue* que = (Queue*)malloc(sizeof(Queue));
11
+ return que;
11
12
  }
12
13
  ```

1

修正

2021/05/11 11:47

投稿

episteme
episteme

スコア16612

answer CHANGED
@@ -6,6 +6,7 @@
6
6
  };
7
7
 
8
8
  struct kozotai* constructor() {
9
+ typedef struct kozotai Queue;
9
- return (struct kozotai*)malloc(sizeof(struct kozotai));
10
+ return (Queue*)malloc(sizeof(Queue));
10
11
  }
11
12
  ```