Possible Duplicate:
Splitting a string in C++
I can't use boost (as I've seen as a solution for a lot of tokenizing questions). First I place a typed command into a string. Command example:
add (name, phone-number)
int main()
{
string line;
cin >> line;
cout << "Reservations>>";
if(line[0] == 'a'){
}
}
I need to make sure everything is correct syntactically (that they used parenthesis and commas), which I was going to do by first breaking the string down into strings themselves, placed in a vector. So my first question is: How can I just break off each part separated by a space so that I can push it into the vector? I was then going to compare '(' with the string of vector[1]'s first char ([0]), and ',' with the string of vector[1]'s [line.length()] - how would I go about referencing certain characters in the string located in a vector?