Adm1n_0v3rride

Reverse string C++

Feb 20th, 2018
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // A quickly written program for reversing a string
  2. // using reverse()
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. int main()
  6. {
  7.    string str = "geeksforgeeks";
  8.    
  9.    // Reverse str[beign..end]
  10.    reverse(str.begin(),str.end());
  11.    
  12.    cout << str;
  13.    return 0;
  14. }
RAW Paste Data