- 论坛徽章:
- 0
|
#include <iostream>;
#include <cctype>;
using std::cout;
using std::cin;
using std::endl;
void ShowAllUppers(char* const str);
int main()
{
char hb[] = "Happy birthday";
ShowAllUppers(hb);
return 0;
}
void ShowAllUppers(char* const str)
{
int i = 0;
while(*(str+i))
{
*(str+i) = std::toupper(*(str+i));
i++;
}
std::cout<<str;
}
编译后提示:
Compiling...
constptr.cpp
E:\battlefiled\constptr.cpp(22) : error C2039: 'toupper' : is not a member of 'std'
Error executing cl.exe.
constptr.exe - 1 error(s), 0 warning(s) |
|