fork download
  1. void Reverse(char *s) {
  2. int j = 1, len = strlen(s);
  3. for (j; j<= len; j++) {
  4. printf("%c", *(s+len-j));
  5. }
  6. puts("\n");
  7. }
  8.  
  9. void ReversW(char *s) {
  10. int j = 1, len = strlen(s);
  11. char out[len+1];
  12. for (j; j<= len; j++) {
  13. out[j-1] = *(s+len-j);
  14. }
  15. printf("%s\n", out);
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'Reverse':
prog.c:2:2: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  int j = 1, len = strlen(s);
  ^
prog.c:2:19: warning: incompatible implicit declaration of built-in function 'strlen'
  int j = 1, len = strlen(s);
                   ^
prog.c:3:2: warning: statement with no effect [-Wunused-value]
  for (j; j<= len; j++) {
  ^
prog.c:4:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   printf("%c", *(s+len-j));
   ^
prog.c:4:3: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:6:2: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
  puts("\n");
  ^
prog.c: In function 'ReversW':
prog.c:10:19: warning: incompatible implicit declaration of built-in function 'strlen'
  int j = 1, len = strlen(s);
                   ^
prog.c:12:2: warning: statement with no effect [-Wunused-value]
  for (j; j<= len; j++) {
  ^
prog.c:15:2: warning: incompatible implicit declaration of built-in function 'printf'
  printf("%s\n", out);
  ^
/usr/lib/gcc/i586-linux-gnu/4.9/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty