A little challenge: "Reverse a string"

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7

90 Replies - 47266 Views - Last Post: 13 June 2015 - 10:26 AM

#91 KeyKrusher  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 08-June 15

Re: A little challenge: "Reverse a string"

Posted 13 June 2015 - 10:26 AM

I totally got this. C++ makes it rather easy
#include <iostream>
#include <string>

int main() {
   std::cout << "Enter a string!";
   string inputString;
   std::cin >> inputString;
   std::endl;
   std::cout << "You're reversed string is: " << std::reverse(inputString) << endl;
}


Ahh, good 'ole std::reverse.
Was This Post Helpful? 0
  • +
  • -

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7