严重的警告~!
scanner.h
class Scanner
{
public:
Scanner(char const *buffer);
//...
private:
const char *const buf;
void EatBlank();
//...
};
scanner.cpp
Scanner::Scanner(const char *buffer):buf(buffer)
{
std::cout < < "Scanner with\ " " < < buf < < "\ " " < < std::endl;
Accept();
}
void Scanner::EatBlank()
{
while( isspace(buf[curr_look]) )
{
++curr_look;
}
}
//...
c:\cpp.pjt\vs 2005\scanner\scanner\scanner.cpp(16) : warning C6328: 已将“const char”作为参数“1”传递,而需要使用“unsigned char”调用“isspace”
char *p; //p将在strtod里初始化
number=strtod(&buf[curr_look],&p);
curr_look=int(p-buf);
warning C6328: 已将“const char”作为参数“1”传递,而需要使用“unsigned char”调用“isspace”
两个问题,谢谢
[解决办法]
提示很清楚嘛
类型不符合函数调用的要求,用static_cast <unsigned char> 转换一下.
while( isspace(buf[curr_look]) )
-〉
while( isspace(static_cast <unsigned char> (buf[curr_look])))
[解决办法]
表示已经参数。
[解决办法]
什么意思??