You should start with reading each line with std::getline
, store the line in a std::stringstream
, then read the individual tokens using the overloaded std::getline
that takes a delimiter.
You can then parse these tokens to integers using std::stoi
, and store them in a std::vector< std::pair >
.
A good explanation with a working code sample can be found here.