For my program i need to read three different things per line, the format of the .txt file is:
Fe B 2
O Xe 0
Al Ca 3
I need to read the three values from each line into three variables and then process those variables through some if statements.
So for example, line 1 i need to read 'Fe' as the first string and then skip the whitespace and read 'B' as the next string then thirdly skip the next whitespace and read '2' as a type int.
That's my only problem so if i can get a way to read the three values into different variables and ignore the whitespace then i know how to do the rest.
#include <fstream>
//...
std::ifstream i("myfile.txt");
std::string a, b;
int c;
while(i >> a >> b >> c) // This will read untill end of file
{
//do stuff
}