小编use*_*913的帖子

C++名称空间混淆 - std :: vs :: vs对tolower的调用没有前缀?

为什么是这样?

transform(theWord.begin(), theWord.end(), theWord.begin(), std::tolower); - 不起作用 transform(theWord.begin(), theWord.end(), theWord.begin(), tolower); - 不起作用

transform(theWord.begin(), theWord.end(), theWord.begin(), ::tolower); - 确实有效

theWord是一个字符串.我是using namespace std;

为什么它与前缀一起使用::而不是与std::或没有?

谢谢你的帮助.

c++ namespaces name-decoration

5
推荐指数
1
解决办法
3144
查看次数

标签 统计

c++ ×1

name-decoration ×1

namespaces ×1