Record Detail

Compile Error

/in/ex1.c: In function 'main':
/in/ex1.c:14:13: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[10]' [-Werror=format=]
     scanf("%s", &command);
            ~^   ~~~~~~~~
/in/ex1.c:17:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Werror=implicit-function-declaration]
         gets(arr);
         ^~~~
         fgets
/in/ex1.c:19:17: error: implicit declaration of function 'strupr'; did you mean 'strstr'? [-Werror=implicit-function-declaration]
         *arr = *strupr(arr);
                 ^~~~~~
                 strstr
/in/ex1.c:19:16: error: invalid type argument of unary '*' (have 'int')
         *arr = *strupr(arr);
                ^~~~~~~~~~~~
/in/ex1.c:30:31: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
             for (int j = 0; j < strlen(a[i].name); j++) {
                               ^
/in/ex1.c:36:13: error: statement with no effect [-Werror=unused-value]
             for (ptr; ptr < strlen(a[i].name); ptr++) {
             ^~~
/in/ex1.c:36:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
             for (ptr; ptr < strlen(a[i].name); ptr++) {
                           ^
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Problem
Mid2 Ex1
Homework
Midterm Exam 2
Language
C
Submit At
2022-07-08 16:19:02
Judged At
2022-07-08 16:19:02
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes