我必须确定输入是数字还是字符串。
std::string s;
while (std::cin >> s) {
if(isdigit(s)){
//do something with the variable
}
else{
//do something else with the variable
}
}
Run Code Online (Sandbox Code Playgroud)
为此,我得到
error: no matching function for call to 'isdigit(std::__cxx11::string&)'
有人可以提出我应该使用的方法吗?