fork(2) download
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char arr[]= "hello";
  8. int low = 0;
  9. int high = strlen(arr)-1;
  10. char temp;
  11.  
  12. while(low < high) {
  13. temp = arr[low];
  14. arr[low] = arr[high];
  15. arr[high] = temp;
  16. low++;
  17. high--;
  18. }
  19. cout<<arr;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
olleh