reading data from a text file

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 10
Reputation: rukshenaa is an unknown quantity at this point 
Solved Threads: 0
rukshenaa rukshenaa is offline Offline
Newbie Poster

reading data from a text file

 
0
  #1
Apr 1st, 2008
hai everybody!!!!!!!!!!

how to read data from a text file and store into an array.........
can anyone help me with the coding in vc++...............
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 1,873
Reputation: twomers has a spectacular aura about twomers has a spectacular aura about twomers has a spectacular aura about 
Solved Threads: 56
twomers's Avatar
twomers twomers is offline Offline
Posting Virtuoso

Re: reading data from a text file

 
0
  #2
Apr 1st, 2008
Well, first #include <fstream>. Make a type called std::ifstream. This is a stream which can read from files. You should have an array declared so loop through its elements and insert what you read from the file into the successive elements of the array... There's an example here somewhere http://www.cplusplus.com/reference/i...tor%3E%3E.html
I blag!?
"Mr Kitty, you have to live in the attic now. Here, write a diary."
I am the Walrus!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC