fork download
  1. char* reverse(char*);
  2. main()
  3. {
  4. printf("\n%s", reverse("computer"));
  5. }
  6. char* reverse(char *p)
  7. {
  8. int l,i;
  9. char t;
  10. for(l=0;*(p+l)!='\0';l++);
  11. for(i=0;i<l/2;i++)
  12. {
  13. t=*(p+i);
  14. *(p+i)=*(p+l-1-i);
  15. *(p+l-1-i)=t;
  16. }
  17. return(p);
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:1: error: return type defaults to ‘int’ [-Werror=implicit-int]
 main()
 ^~~~
prog.c: In function ‘main’:
prog.c:4:1: error: implicit declaration of function ‘printf’ [-Werror=implicit-function-declaration]
 printf("\n%s", reverse("computer"));
 ^~~~~~
prog.c:4:1: error: incompatible implicit declaration of built-in function ‘printf’ [-Werror]
prog.c:4:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
cc1: all warnings being treated as errors
stdout
Standard output is empty