fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char * h = "Hello World\n";
  5. printf("%s", h);
  6. reverse(h);
  7. return 0;
  8. }
  9.  
  10. void reverse(char *str) {
  11. char * end = str;
  12. char tmp;
  13. if (str) {
  14. while (*end) {
  15. printf("while %s", end);
  16. ++end;
  17. }
  18. --end;
  19. while (str < end) {
  20. tmp = *str;
  21.  
  22. printf("swapwhile %c\n", tmp);
  23. *str = *end;
  24. str++;
  25. // *str++ = *end;
  26. *end-- = tmp;
  27. }
  28.  
  29. }
  30. }
  31.  
Runtime error #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Standard output is empty