菜鸟一名,求助,百度了这段错误提示,可是没找到答案。请说简单一点,刚学c++没多久。谢谢
ringa_lee2017-04-17 11:32:12
The error message is obvious, there is no such function.
It is said that there is no such function as toupper(string) in C++, and there is no such function as toupper(char *) in C. You can only use toupper(char) character by character.
ringa_lee2017-04-17 11:32:12
The error I see here is
toupper.cc: In function ‘int main()’:
toupper.cc:17: error: cannot convert ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ to ‘int’ for argument ‘1’ to ‘int toupper(int)’
http://www.cplusplus.com/reference/cctype/toupper/
From this document, it seems that toupper
should be the C
function, but it accepts int
, and the questioner passed string
, so it is not match
.