Record Detail

Compile Error

/in/main.c: In function 'main':
/in/main.c:28:21: error: format '%d' expects a matching 'int' argument [-Werror=format=]
         printf("%s %d",ai.name);
                    ~^
/in/main.c:27:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
     for(i=1;i<17;i+=2)
     ^~~
/in/main.c:29:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
         randomnum(ai.rank,a(i+1),integer_k);
         ^~~~~~~~~
/in/main.c:29:27: error: implicit declaration of function 'a' [-Werror=implicit-function-declaration]
         randomnum(ai.rank,a(i+1),integer_k);
                           ^
/in/main.c:16:9: error: unused variable 's' [-Werror=unused-variable]
     int s,integer_k;
         ^
/in/main.c: At top level:
/in/main.c:36:1: error: expected identifier or '(' before '}' token
 }
 ^
/in/main.c: In function 'randomnum':
/in/main.c:42:11: error: unused variable 'p' [-Werror=unused-variable]
     float p=(float)rand()/RAND_MAX;
           ^
/in/main.c: In function 'main':
/in/main.c:22:9: error: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Werror=unused-result]
         scanf("%s %d",ai.name,&ai.rank);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab 5
Language
C
Submit At
2018-06-26 21:03:08
Judged At
2018-06-26 21:08:01
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes