コマンドラインから入力として行を取得しようとしています。私の問題は、行全体が取得されていないことですが、スペースによってトークン化されています。
だから、「数学が大好き」などと入力すると、
"you enterend: I like Math a lot"
私は次のようになります:
EDITING MODE: Enter a command
i like Math a lot
you entered i
EDITING MODE: Enter a command
you entered like
EDITING MODE: Enter a command
you entered Math
EDITING MODE: Enter a command
you entered a
EDITING MODE: Enter a command
you entered lot
void enterEditingMode(){
editingMode = TRUE;
static string CMD = "\nEDITING MODE: Enter a command\n";
string input;
while(editingMode == TRUE){
cout << CMD;
cin >> input;
//we assume input is always correct
// here we need to parse the instruction
cout << "you entered " << input <<endl;