| | |
ifstream help?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
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
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.
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.
![]() |
Similar Threads
- C++: ifstream file pointer not getting reset (C++)
- Reusing ifstream (C++)
- ifstream file (C++)
- need help with saving in ofstream, ifstream (C++)
- noob questions- ifstream ofstream (C++)
- Is ifs is a member function of ifstream class (C++)
Other Threads in the C++ Forum
- Previous Thread: Getting some code for COM1 communitcation
- Next Thread: muliplying without using a * operator!
Views: 1507 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int integer java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






