记录详情

Compile Error

/in/foo.c:5:2: error: unknown type name 'word'
  word* next;
  ^~~~
/in/foo.c: In function 'main':
/in/foo.c:11:8: error: 'new' undeclared (first use in this function)
  cmp = new char[100];
        ^~~
/in/foo.c:11:8: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:11:12: error: expected ';' before 'char'
  cmp = new char[100];
            ^~~~
/in/foo.c:12:10: error: expected ';' before 'char'
  a = new char[100000];
          ^~~~
/in/foo.c:14:2: error: unknown type name 'word'
  word* head = NULL, * tail = NULL;
  ^~~~
/in/foo.c:14:2: note: use 'struct' keyword to refer to the type
/in/foo.c:15:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(a);
  ^~~~
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:16:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(cmp);
  ^~~~
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:25:3: error: unknown type name 'word'
   word* newp = new word;
   ^~~~
/in/foo.c:25:3: note: use 'struct' keyword to refer to the type
/in/foo.c:25:20: error: expected ',' or ';' before 'word'
   word* newp = new word;
                    ^~~~
/in/foo.c:29:8: error: request for member 'next' in something not a structure or union
    tail->next = newp;
        ^~
/in/foo.c:31:7: error: request for member 'letter' in something not a structure or union
   newp->letter = a[i];
       ^~
/in/foo.c:32:7: error: request for member 'next' in something not a structure or union
   newp->next = NULL;
       ^~
/in/foo.c:34:2: error: 'delete' undeclared (first use in this function)
  delete[]a;
  ^~~~~~
/in/foo.c:34:9: error: expected expression before ']' token
  delete[]a;
         ^
/in/foo.c:35:7: error: unknown type name 'word'
  for (word* p = head; p != NULL; p = p->next)
       ^~~~
/in/foo.c:35:7: note: use 'struct' keyword to refer to the type
/in/foo.c:35: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:36:17: error: request for member 'letter' in something not a structure or union
   printf("%c", p->letter);
                 ^~
/in/foo.c:13:7: warning: unused variable 'find' [-Wunused-variable]
  char find;
       ^~~~

信息

递交者
类型
递交
题目
P1062 A8-6 删除字符串中多余的多种字符
比赛
2021(四) 作业第四场:加速赛
语言
C
递交时间
2021-12-06 18:19:34
评测时间
2021-12-06 18:19:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes