#include <fstream.h>
#include <iostream.h>
ifstream fin("num.txt");
int number;
while (!fin.eof())
{
number = fin.get();
}
cout << number;
fin.close();
-------
All I am doing is going through a file and getting the last number, I will expand it later to read constants defined a file to compute a solution to 6 Matrix problem. I don't know much about file I/O and even C++ (as I realized this semester to my heartbreak, this code is borrowed from a tutorial site) so any help will be greatly appreciated.
#include <iostream.h>
ifstream fin("num.txt");
int number;
while (!fin.eof())
{
number = fin.get();
}
cout << number;
fin.close();
-------
All I am doing is going through a file and getting the last number, I will expand it later to read constants defined a file to compute a solution to 6 Matrix problem. I don't know much about file I/O and even C++ (as I realized this semester to my heartbreak, this code is borrowed from a tutorial site) so any help will be greatly appreciated.