string name1 = "Sam" ; string name2 = name1 ; /// Have to store the ORIGINAL in ANOTHER variable ...then Reverse that reverse(name2.begin(),name2.end()) ; cout << name2 ; // maS