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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.