ifstream help?

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

Join Date: Feb 2005
Posts: 84
Reputation: evilsilver is an unknown quantity at this point 
Solved Threads: 1
evilsilver's Avatar
evilsilver evilsilver is offline Offline
Junior Poster in Training

ifstream help?

 
0
  #1
Aug 26th, 2005
hey all, i am programmin in c++ (just so we are all on the same page lol) and using Borland compiler 3.

ok here's my problem, i know how to open a file and save variables to it in order to save them for future program reference but i can't get it to load more than one variable from the file, i need to be able to load as many variables as my program needs. i have searched long and hard for this but all my searches on the topic don't talk about the specific problem that i am haveing, it only tells me time and time again that fstream is used for i/o file handeling and things like that. can anyone here help me?

thanks to all those who help and those who try,
-evilsilver
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,653
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: ifstream help?

 
0
  #2
Aug 26th, 2005
post the program that saves the variables. Were the variables written in their ascii format or binary format? If ascii, did you put one or more spaces between them? of just jam them all up together. Open the file in Notepad or some other text editor -- can you distinguish the variable values?

If you want to read back an unknown number of integers (or other data type), read them one at a time and save them in a std::vector.
Reply With Quote Quick reply to this message  
Reply

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




Views: 1507 | Replies: 1
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC