fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct Student {
  4. int id;
  5. char name[20];
  6. }student;
  7.  
  8. int main(void) {
  9. student *s1 = &{1, "Bob"};
  10.  
  11. //s1->id = 2;
  12.  
  13. //printf("%d", s1.id);
  14. //printf("%s", s1.name);
  15. return 0;
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 4308KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:17: error: expected expression before ‘{’ token
  student *s1 = &{1, "Bob"};
                 ^
prog.c:9:11: warning: unused variable ‘s1’ [-Wunused-variable]
  student *s1 = &{1, "Bob"};
           ^~
stdout
Standard output is empty