Reverse String
Last updated
Last updated
For a string 12345
Initially, the function takes a pointer to the two extreme ends.
For each call, it swaps the chars pointed by the two pointers.
Then it increments the smaller pointer, decrements the larger pointer and makes another call.
This keeps repeating until the pointers cross each other.