Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

reverse function in cpp string

// C++ program to illustrate the
// reversing of a string using
// reverse() function
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string str = "geeksforgeeks";
 
    // Reverse str[begin..end]
    reverse(str.begin(), str.end());
 
    cout << str;
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #reverse #function #cpp #string
ADD COMMENT
Topic
Name
6+8 =