我正在尝试获取一个字符串处理程序,该处理程序在字符串类型变量中从用户那里获取输入......但它正在崩溃,我想知道为什么?或者我做错了什么......
string UIconsole::getString(){
string input;
getline(cin,input);
if(input.empty() == false){
return input;
}
else{getString();}
return 0;
}
编辑:错误:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid