fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void print_reverse(char *s)
  5. {
  6. size_t len = strlen(s);
  7. char *t = s + len - 1;
  8. while(t >= s) {
  9. printf("%c", *t);
  10. t = t - 1;
  11. }
  12. puts("");
  13. }
  14.  
  15. int main(void) {
  16. char *hello = "Hello, World";
  17.  
  18. print_reverse(hello);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
dlroW ,olleH