Given a string, the task is to reverse this String using pointers.
Input: Geeks Output: skeeG Input: GeeksForGeeks Output: skeeGroFskeeG
Approach: This method involves taking two pointers, one that points at the start of the string and the other at the end of the string. The characters are then reversed one by one with the help of these two pointers.
Enter a string: GeeksForGeeks Reverse of the string: skeeGroFskeeG
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Program to reverse an array using pointers
- C++ Program to compare two string using pointers
- The length of a string using pointers
- C program to sort an array using pointers
- Different methods to reverse a string in C/C++
- C Program to Reverse Array of Strings
- Reverse a string in C/C++ using Client Server model
- Program to copy the contents of one array into another in the reverse order
- C program to print a string without any quote (singe or double) in the program
- Pointers and References in C++
- What are near, far and huge pointers?
- Pointers vs References in C++
- Pointers in C/C++ with Examples
- Features and Use of Pointers in C/C++
- Applications of Pointers in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.