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 'char **' [-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 'char **'
 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 'char **'
 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 'char **'
 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 'char **'
 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 'char **'
 extern int strcmp (const char *__s1, const char *__s2)
            ^~~~~~
cc1: all warnings being treated as errors

Information

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