初学C++中.
我看的是Ivor Horton写的<入门经典>
在vc60下,按书中代码编译"std::isalpha(..)"时,显示isalpha is not a member of "std".
直接使用isalpha()函数(不带命名空间)是可以通过,而且也不需要引用"cctype"头文件.
为什么是这样呢?
...全文
2745打赏收藏
isalpha 和 tolower是不是std命名空间中的函数?
初学C++中. 我看的是Ivor Horton写的 在vc60下,按书中代码编译"std::isalpha(..)"时,显示isalpha is not a member of "std". 直接使用isalpha()函数(不带命名空间)是可以通过,而且也不需要引用"cctype"头文件. 为什么是这样呢?
isalpha is a macro that classifies ASCII-coded integer values by table lookup. The macro is affected by the current locale category. For the default C locale, c is a letter (A to Z or a to z).