Need to invert the output!
hello ppl...
ok i output this string to a .txt file using ifstream...
Code:
ofstream fout; //to write out to an output file
fout.open("outputfile.txt");
do
{
fout << something;
}
while(something)
fout << flush;
fout.close();
now suppose i was printing city names as output...if it comes in the order Adelaide, Canberra, Melbourne, Sydney during the print to the file, I want it to print in the other direction...
my output should be: Sydney, Melbourne, Canberra, Adelaide...
I guess there's some string copy and then invert operation but i thought you could something like this directly while printing...
any ideas?
Regards,
Farooq