astroyboyy
asked on
c++ code help
how do I read in a string from a file as a charactor array and then reverse the letters of each word ? e.g.
if the file contained :
This is a test
This is a test2
you would read in "This is a test" as a charactor array then reverse the letters to say "sihT si a tset" then read in the second line and reverse those letters as well.
if the file contained :
This is a test
This is a test2
you would read in "This is a test" as a charactor array then reverse the letters to say "sihT si a tset" then read in the second line and reverse those letters as well.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
STL makes the solution trivial. Create a vector<string>, fill it using istream_iterators, use the for_each() function to invoke the reverse() function on all the strings in the vector.