The problem is that I dont know how to use the read() function properly.
You see,in the function getdata(),after taking in the name and number,I dont know how to get the chars to be taken as input into the file using read().
What I mean to say is how to take in the name and num chars to read() and flush it to my file??
Any help is appreciated!!!
Yours friendly newbie,
LadyInRed7.
However that is very likely not what you actually want.
In your case, you can use your file just like you do cin and cout
1 2 3 4 5 6 7 8 9 10 11
fstream file;
file.open("filename",ios::out);//treat file like cout
int ivar = 555;
file << ivar; //puts 555 into the file
file.close();
file.open("filename",ios::in);//now treat file like cin
int ivar2 = 0;
file >> ivar2; //reads 555 from the file into ivar2
file.close();