记录详情

Compile Error

/in/foo.c:6:2: error: unknown type name 'word'
  word* next;
  ^~~~
/in/foo.c: In function 'main':
/in/foo.c:12:6: error: 'new' undeclared (first use in this function)
  a = new char[100000]; 
      ^~~
/in/foo.c:12:6: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:12:10: error: expected ';' before 'char'
  a = new char[100000]; 
          ^~~~
/in/foo.c:13:2: error: unknown type name 'word'
  word* head = NULL, * tail = NULL;
  ^~~~
/in/foo.c:13:2: note: use 'struct' keyword to refer to the type
/in/foo.c:14:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(a, 100000);
  ^~~~
In file included from /in/foo.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.c:14:2: error: too many arguments to function 'gets'
  gets(a, 100000);
  ^~~~
In file included from /in/foo.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.c:30:3: error: unknown type name 'word'
   word* newp = new word;
   ^~~~
/in/foo.c:30:3: note: use 'struct' keyword to refer to the type
/in/foo.c:30:20: error: expected ',' or ';' before 'word'
   word* newp = new word;
                    ^~~~
/in/foo.c:34:8: error: request for member 'next' in something not a structure or union
    tail->next = newp;
        ^~
/in/foo.c:36:7: error: request for member 'letter' in something not a structure or union
   newp->letter = a[i];
       ^~
/in/foo.c:37:7: error: request for member 'next' in something not a structure or union
   newp->next = NULL;
       ^~
/in/foo.c:39:2: error: 'delete' undeclared (first use in this function)
  delete[]a;
  ^~~~~~
/in/foo.c:39:9: error: expected expression before ']' token
  delete[]a;
         ^
/in/foo.c:40:7: error: unknown type name 'word'
  for (word* p = head; p != NULL; p = p->next)
       ^~~~
/in/foo.c:40:7: note: use 'struct' keyword to refer to the type
/in/foo.c:40:39: error: request for member 'next' in something not a structure or union
  for (word* p = head; p != NULL; p = p->next)
                                       ^~
/in/foo.c:41:17: error: request for member 'letter' in something not a structure or union
   printf("%c", p->letter);
                 ^~

信息

递交者
类型
递交
题目
P1063 A8-7 删除字符串中一个子串
比赛
2021(四) 作业第四场:加速赛
语言
C
递交时间
2021-12-06 18:31:10
评测时间
2021-12-06 18:31:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes