fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5. int main(void) {
  6. int i = 0;
  7. char str[] = "testString";
  8. int len = strlen(str);
  9.  
  10. for(i = 0; i < len/2; i++){
  11. str[len - i - 1] ^= str[i];
  12. str[i] ^= str[len - i - 1];
  13. str[len - i - 1] ^= str[i];
  14. }
  15.  
  16. printf("Reverse String %s \n", str);
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
Reverse String gnirtStset