using std::string for splitting up a line

If I had a line like:

G3421,accountant,Gary Daniels,gdaniels72@gmail.com

and I have

int pos = line.find(",", 0);
if (pos != std::string::npos)
{
std::string empID(line.begin(), line.begin() + pos);
std::string empType(line.begin() + pos + 1, line.end());
}

That would give me empID = "G3421"
but empType = "accountant,Gary Daniels,gdaniels72@gmail.com"

What do I need to do to be able to stop std::string empType at the next ","
and have std::string empName start at the correct position?

I'm sorry if the tutorials kind of explain this but I'm having difficulty with positioning.
Topic archived. No new replies allowed.