fork download
  1. #include <stdio.h>
  2.  
  3. #define SIZE 10
  4.  
  5. int reverse(int);
  6.  
  7. int main()
  8. {
  9. int i;
  10. int line[SIZE];
  11.  
  12. for (i = 0; i < SIZE ; ++i)
  13. line[i] = i;
  14.  
  15. printf ("%d", reverse(line));
  16.  
  17. return 0;
  18. }
  19.  
  20. int reverse(int s[])
  21. {
  22. int i;
  23. int result[SIZE];
  24.  
  25. for (i = 0; i < SIZE; ++i)
  26. result[SIZE - i] = s[i];
  27.  
  28. return result;
  29.  
  30. }
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:15:2: warning: passing argument 1 of ‘reverse’ makes integer from pointer without a cast [enabled by default]
  printf ("%d", reverse(line));
  ^
prog.c:5:5: note: expected ‘int’ but argument is of type ‘int *’
 int reverse(int);
     ^
prog.c: At top level:
prog.c:20:5: error: conflicting types for ‘reverse’
 int reverse(int s[])
     ^
prog.c:5:5: note: previous declaration of ‘reverse’ was here
 int reverse(int);
     ^
prog.c: In function ‘reverse’:
prog.c:28:2: warning: return makes integer from pointer without a cast [enabled by default]
  return result;
  ^
prog.c:28:2: warning: function returns address of local variable [-Wreturn-local-addr]
stdout
Standard output is empty