fork download
  1. #include <stdio.h>
  2. struct stud
  3. {
  4. // int reg;
  5. char name[100];
  6. // float marks;
  7. };
  8. int main(void)
  9. {
  10. stud s;
  11. scanf("%s",&s.name);
  12. printf("%s",s.name);
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 4488KB
stdin
sharm
compilation info
prog.c: In function ‘main’:
prog.c:10:2: error: unknown type name ‘stud’
  stud s;
  ^~~~
prog.c:10:2: note: use ‘struct’ keyword to refer to the type
prog.c:11:15: error: request for member ‘name’ in something not a structure or union
  scanf("%s",&s.name);
               ^
prog.c:12:15: error: request for member ‘name’ in something not a structure or union
  printf("%s",s.name);
               ^
prog.c:10:7: warning: variable ‘s’ set but not used [-Wunused-but-set-variable]
  stud s;
       ^
stdout
Standard output is empty