fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. struct some_struct {int some; char value;};
  6. struct some_struct *s = malloc(sizeof(struct some_struct));
  7. *s = struct some_struct {.some = 5, .value = 'a'};
  8. printf("some = %d, value = %c\n", s->some, s->value);
  9. return 0;
  10. }
  11.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:7:7: error: expected expression before ‘struct’
  *s = struct some_struct {.some = 5, .value = 'a'};
       ^~~~~~
stdout
Standard output is empty