fork download
  1. #include <stdio.h>
  2. struct S {
  3. int S;
  4. };
  5. int f(struct S *s) {
  6. return --s.S;
  7. }
  8. int main(void) {
  9. int i;
  10. struct S S = { 2 };
  11. i = f(S);
  12. printf("%d",i);
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘f’:
prog.c:6:19: error: ‘s’ is a pointer; did you mean to use ‘->’?
         return --s.S;
                   ^
                   ->
prog.c: In function ‘main’:
prog.c:11:15: error: incompatible type for argument 1 of ‘f’
         i = f(S);
               ^
prog.c:5:9: note: expected ‘struct S *’ but argument is of type ‘struct S’
     int f(struct S *s) {
         ^
prog.c: In function ‘f’:
prog.c:7:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
stdout
Standard output is empty