-
I/o
I just wanted to see some of the better ways for i/o. I only know how to do the <IOSTREAM> and <fstream.h> commands. Is there a way where u could store an integer and other stuff and go strait to the integer and retrieve it or to somehow put a pointer to that spot in the file?
-
intresting!? can u please explain further
-
Use function parameters, global variables (don't use these unless there is NO other way), or creating a class (try to use accessor functions instead of making the member variable public). These are just the ones I know of.
-
Better Explanation
I want to be able to store a string, integer, etc... without having to do something like this to find a certain spot and then read from that spot.
Code:
...
char c;
string s;
ifstream F("name.txt");
for(int i = 0;c!='spot1';i++;)
{
F.get(c);
}
s=F.getline;
...
Is there a way to do that?
P.S.
I dont care if the code above has errors or not