fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define prenommax 30
  4. #define nommax 30
  5. #define tabmax 5
  6. struct eleve{
  7. char prenom[prenommax];
  8. char nom[nommax];
  9. unsigned char age;
  10. }
  11. int main() {
  12. struct eleve elevetab[tabmax];
  13. int i;
  14. for(i=0;i<=tabmax;i++){
  15. printf("nom");
  16. scanf("%s",elevetab[i].nom);
  17. printf("prenom");
  18. scanf("%s",elevetab[i].prenom);
  19. printf("age");
  20. scanf("%uc",elevetab[i].age);
  21.  
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:11:1: error: expected ‘;’, identifier or ‘(’ before ‘int’
 int main() {
 ^~~
prog.c: In function ‘main’:
prog.c:20:11: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 2 has type ‘int’ [-Wformat=]
   scanf("%uc",elevetab[i].age);
          ~^   ~~~~~~~~~~~~~~~
prog.c:16:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",elevetab[i].nom);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:18:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",elevetab[i].prenom);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:20:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%uc",elevetab[i].age);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
stdout
Standard output is empty