ifstream infile;
infile.open("graph.txt");
string line;
while (getline(infile, line))
{
//TODO
}
infile.close();
I am taking input line by line from the file and storing each line in the string "line".
Each line contains integers separated by tabs. I want to get these integers separated and store each integer inside a vector. But I don't know how to proceed. Is there something like a split
function for strings in C++?