To get a full inline string, you need to type:
>> string fullName;
>> getline(cin,fullName);
>> cout << fullName << endl;
>> char fullName[50];
>> getline.cin(fullName, 50); // length of text
>> cout << fullName << endl;
>> getline(cin,fullDesc,'#');
>> cout << fullDesc << endl;
or
>> getline.cin(fullName, 50); // length of text
>> cout << fullName << endl;
If you want to get some line from prompt, you can type:
>> string fullDesc;>> getline(cin,fullDesc,'#');
>> cout << fullDesc << endl;
No comments:
Post a Comment