Record Detail

Compile Error

/in/main.c: In function 'create':
/in/main.c:17:12: error: expected '{' before '*' token
     struct *p1 =NULL;
            ^
/in/main.c:18:12: error: expected '{' before '*' token
     struct *p2 =NULL;
            ^
/in/main.c:21:5: error: 'p1' undeclared (first use in this function)
     p1 = (struct country *)malloc(LEN);
     ^~
/in/main.c:21:5: note: each undeclared identifier is reported only once for each function it appears in
/in/main.c:22:5: error: 'p2' undeclared (first use in this function)
     p2 =p1;
     ^~
/in/main.c:25:5: error: implicit declaration of function 'scanf_s' [-Werror=implicit-function-declaration]
     scanf_s("%s %d",&(p1->name),&(p1->rank));
     ^~~~~~~
/in/main.c:20:9: error: unused variable 'n' [-Werror=unused-variable]
     int n =0;
         ^
/in/main.c:16:21: error: variable 'head' set but not used [-Werror=unused-but-set-variable]
     struct country *head;
                     ^~~~
/in/main.c: At top level:
/in/main.c:38:5: error: expected identifier or '(' before 'return'
     return 0;
     ^~~~~~
/in/main.c:39:1: error: expected identifier or '(' before '}' token
 }
 ^
/in/main.c: In function 'create':
/in/main.c:28:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab 5
Language
C
Submit At
2018-06-28 23:33:27
Judged At
2018-06-28 23:33:27
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes