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

Popular posts from this blog

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

c# - MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3243,9): error MSB4094 -