parsing - Splitting a String C++ -
i entering type of input command line :
mynameis "jason roger"
i want have mynameis , jason roger in 2 different strings. failed in printing input. when use
string command; cin>>command cout<<command<<endl;
i
mynameis
how can fix this? thanks.
the >>
operator reads input stream (cin
, here) until hits whitespace character. might want @ getline
function instead, need split string manually.
Comments
Post a Comment