I have a file with a simple number, for example:
66
or
126
How can I read this value intin C ++?
Please note that the file may also contain spaces or enter after the number.
I started like this:
int ReadNumber()
{
fstream filestr;
filestr.open("number.txt", fstream::in | fstream::app);
filestr.close()
}
How to proceed?
Thank.
source
share