954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can i write program that writes into a file from an array of string and reverse

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

Please help

mertucci
Newbie Poster
16 posts since May 2008
Reputation Points: 10
Solved Threads: 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.

n1337
Junior Poster in Training
96 posts since May 2008
Reputation Points: 55
Solved Threads: 10
 

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

joshmo
Posting Whiz in Training
280 posts since Oct 2007
Reputation Points: 19
Solved Threads: 20
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You