Here is my Code
#include <iostream>
#include <conio.h>
#include <fstream>
using namespace std;
int main()
{
char n, d;
string s;
// ofstream out("sample.txt");
ifstream in("sample.txt");
while (!in.eof())
{
if (in.eof())
break;
in >> s;
}
cout << s << endl;
n = (s[6]*10);
cout << n << endl;
return 0;
}
Basically , in file there is a table of 5 line by line. I extracted last string of file which is
5*10=50
but what I Need is last number 50 in an int to furthur process my program. How can I get that last number of string and file into an Integer Variabe?