0

Question is:
"Write a complete program that writes into a file from an array of string and also in reverse
order."

Please help

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by joshmo
0

Again, be specific with the areas of difficulty...

An array of strings? My question is, suppose you had the array:

{ "me", "you", "us" }

Does the output need to be reversed like "us", "you", "me" (if so, just start at the last index and move backwards), or "su" "uoy" "em"...

Either way, you should be able to think about it...simple manipulation...

The problem requires you being able to write to a file (which you should understand, if not google search it...), and pass through an array...again, you should be able to handle this...but post back with your attempted code and specific areas of difficulty.

0

you need to use file streams found in fstream.h..here is a simple implementation example

ofstream outfile; 
outfile.open("file.txt"); // open the file for writing
outfile<< /*your array here*/;
outfile.close();

the above is just giving an idea on how you should go about it..hope it helps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.