Record Detail

Compile Error

/in/ex6.c: In function 'removebook':
/in/ex6.c:27:34: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Werror=int-conversion]
         if (strcmp(initial->name,name)){
                                  ^~~~
In file included from /in/ex6.c:2:0:
/usr/include/string.h:136:12: note: expected 'const char *' but argument is of type 'char'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/ex6.c:28:13: error: null argument where non-null required (argument 2) [-Werror=nonnull]
             strcpy(initial->name,'\0');
             ^~~~~~
/in/ex6.c:23:33: error: unused parameter 'number' [-Werror=unused-parameter]
 book* removebook(book *head,int number){
                                 ^~~~~~
/in/ex6.c:33:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
/in/ex6.c:27:13: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         if (strcmp(initial->name,name)){
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Midterm Exam 2
Language
C
Submit At
2022-07-07 15:41:50
Judged At
2022-07-08 16:06:01
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes