Record Detail

Compile Error

/in/hotel-main.c: In function 'main':
/in/hotel-main.c:20:17: error: format '%s' expects argument of type 'char *', but argument 2 has type 'int *' [-Werror=format=]
         scanf("%s", operation);
                 ^
/in/hotel-main.c:21:20: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types]
         if (strcmp(operation, "breakfast") == 0)breakfast(headr);
                    ^~~~~~~~~
In file included from /in/hotel-ll.h:6:0,
                 from /in/hotel-main.c:1:
/usr/include/string.h:140:12: note: expected 'const char *' but argument is of type 'int *'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/hotel-main.c:22:25: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types]
         else if (strcmp(operation, "nights") == 0)nights(headr);
                         ^~~~~~~~~
In file included from /in/hotel-ll.h:6:0,
                 from /in/hotel-main.c:1:
/usr/include/string.h:140:12: note: expected 'const char *' but argument is of type 'int *'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/hotel-main.c:23:25: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types]
         else if (strcmp(operation, "date") == 0)date(headr);
                         ^~~~~~~~~
In file included from /in/hotel-ll.h:6:0,
                 from /in/hotel-main.c:1:
/usr/include/string.h:140:12: note: expected 'const char *' but argument is of type 'int *'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/hotel-main.c:24:25: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types]
         else if (strcmp(operation, "checkin") == 0)checkin(headr);
                         ^~~~~~~~~
In file included from /in/hotel-ll.h:6:0,
                 from /in/hotel-main.c:1:
/usr/include/string.h:140:12: note: expected 'const char *' but argument is of type 'int *'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
/in/hotel-main.c:25:25: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types]
         else if (strcmp(operation, "0") == 0)return 0;
                         ^~~~~~~~~
In file included from /in/hotel-ll.h:6:0,
                 from /in/hotel-main.c:1:
/usr/include/string.h:140:12: note: expected 'const char *' but argument is of type 'int *'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
cc1: all warnings being treated as errors
/in/hotel-mt.c: In function 'initialise':
/in/hotel-mt.c:45:32: error: too many arguments for format [-Werror=format-extra-args]
                     fprintf(fp,"name%d=\nid%d=\n", k+1,k+1,k+1,k+1,k+1,k+1,k+1);
                                ^~~~~~~~~~~~~~~~~~
/in/hotel-mt.c:55:32: error: too many arguments for format [-Werror=format-extra-args]
                     fprintf(fp,"name%d=\nid%d=\n", k+1,k+1,k+1,k+1,k+1,k+1,k+1);
                                ^~~~~~~~~~~~~~~~~~
/in/hotel-mt.c: In function 'chincard':
/in/hotel-mt.c:193:16: error: too many arguments for format [-Werror=format-extra-args]
         printf("-The ID number of the visitor: %s, %s",headr->vinfo->id,headr->vinfo->next_v->id,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
/in/hotel-ll.c: In function 'hotel_ll':
/in/hotel-ll.c:5:12: error: unused variable 'vmax' [-Werror=unused-variable]
     int ch,vmax;
            ^~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 2
Language
C
Submit At
2018-07-17 08:04:04
Judged At
2018-07-17 08:04:04
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes