std::string comes with tools you wrote by hand in C: s.size(), s.substr(pos, len), s.find(c) (which returns std::string::npos when there is no match) and std::string(count, ch) to repeat a character. std::vector adds push_back, back(), empty() and clear().
std::stoi(text, &pos) converts text to an int and stores in pos how many characters it used. When the text does not start with a number it throws std::invalid_argument, and when the number does not fit in an int it throws std::out_of_range. A try block runs code that may throw, and a catch block handles the error:
try { n = std::stoi(text); } catch (const std::exception&) { n = fallback; }
Unlike atoi, a failed conversion cannot be mistaken for a zero.
Split a line on commas, keeping empty fields.