Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,964 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,360 people online right now. Registration is fast and FREE... Join Now!




Read in and write out .txt files

 
Reply to this topicStart new topic

Read in and write out .txt files, Read in integers and create and write out a sorted list of those integ

Irishancest
4 Dec, 2007 - 07:21 AM
Post #1

New D.I.C Head
*

Joined: 2 Nov, 2007
Posts: 14


My Contributions
Hey, can anyone tell me how to accept a .txt file in command line and read in a series of ints, place them in an array, and after the array has been sorted, to output a new .txt file with the sorted ints?
User is offlineProfile CardPM
+Quote Post

lockdown
RE: Read In And Write Out .txt Files
4 Dec, 2007 - 07:36 AM
Post #2

D.I.C Regular
Group Icon

Joined: 29 Sep, 2007
Posts: 376



Thanked: 1 times
Expert In: PC, Support

My Contributions
Read up on the #include <fstream>.

You will needed to uses the ofstream, ifstream, and fstream commands to get what you want.
User is offlineProfile CardPM
+Quote Post

Irishancest
RE: Read In And Write Out .txt Files
4 Dec, 2007 - 08:00 AM
Post #3

New D.I.C Head
*

Joined: 2 Nov, 2007
Posts: 14


My Contributions
Thank you, do you know a good resource where I can read up on that?
User is offlineProfile CardPM
+Quote Post

lockdown
RE: Read In And Write Out .txt Files
4 Dec, 2007 - 08:05 AM
Post #4

D.I.C Regular
Group Icon

Joined: 29 Sep, 2007
Posts: 376



Thanked: 1 times
Expert In: PC, Support

My Contributions
Its under the tutorials section of the site. It will go over mainly how to get what you want. Also if that dose not answer all your question just post it up and a member will try and explain it for u.

Here is the direct link so you dont need to go searching for it.
http://www.dreamincode.net/forums/showtopic13930.htm

Good luck with your app. I have been working on something related to it for about a month now. Its a inventory application im building and sending data to and from a file is really helpful.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 06:19PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month