I have a file with a simple number, for example:
66
or
126
How can I read it to a int
value in C++?
Note that the file may also contain some spaces or enters after the number.
I started like so:
int ReadNumber()
{
fstream filestr;
filestr.open("number.txt", fstream::in | fstream::app);
filestr.close()
}
How to continue?
Thanks.