Record Detail

Compile Error

/in/main.c: In function 'main':
/in/main.c:27:17: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[4]' [-Werror=format=]
         scanf("%s",&nametmp);
                ~^  ~~~~~~~~
/in/main.c:49:11: error: implicit declaration of function 'time' [-Werror=implicit-function-declaration]
     srand(time(k));
           ^~~~
/in/main.c: In function 'winrate':
/in/main.c:58:14: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[4]' [-Werror=format=]
     printf("%s",&ctya->name);
             ~^  ~~~~~~~~~~~
/in/main.c:67:27: error: integer overflow in expression [-Werror=overflow]
     double r = x/(RAND_MAX+1);
                           ^
/in/main.c:70:18: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[4]' [-Werror=format=]
         printf("%s\n",&(ctyb->name));
                 ~^    ~~~~~~~~~~~~~
/in/main.c:75:18: error: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[4]' [-Werror=format=]
         printf("%s\n",&(ctyb->name));
                 ~^    ~~~~~~~~~~~~~
/in/main.c: In function 'main':
/in/main.c:21:5: error: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Werror=unused-result]
     scanf("%d",&seed);
     ^~~~~~~~~~~~~~~~~
/in/main.c:22:5: error: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Werror=unused-result]
     scanf("%d",&k);
     ^~~~~~~~~~~~~~
/in/main.c:27:9: error: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Werror=unused-result]
         scanf("%s",&nametmp);
         ^~~~~~~~~~~~~~~~~~~~
/in/main.c:28:9: error: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Werror=unused-result]
         scanf("%d",&tmp);
         ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab 5
Language
C
Submit At
2018-06-26 20:16:57
Judged At
2018-06-26 21:07:56
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes