可能重复:
Convert a String In C++ To Upper CaseC++ toupper - 标准函数?
嗨, 我需要便携式功能串++转换成C到大写。我现在使用toupper(char);功能。它是一个标准功能吗?如果没有,那么跨平台的正确方法是什么?顺便说一下,有没有可以列出所有C++标准函数的web/wiki?谢谢。
可能重复:
Convert a String In C++ To Upper CaseC++ toupper - 标准函数?
嗨, 我需要便携式功能串++转换成C到大写。我现在使用toupper(char);功能。它是一个标准功能吗?如果没有,那么跨平台的正确方法是什么?顺便说一下,有没有可以列出所有C++标准函数的web/wiki?谢谢。
是,toupper
在cctype
头声明。你可以将一个字符串的算法:
#include <algorithm>
#include <iostream>
#include <string>
#include <cctype>
int main()
{
std::string str("hello there");
std::cout << str << '\n';
std::transform(str.begin(), str.end(), str.begin(), std::toupper);
std::cout << str << '\n';
}
对于后面的问题,有http://www.cplusplus.com/。
喜在我们的项目中,我们使用升压/算法/串to_upper功能项目用于Windows和Linux
你需要范围解析操作 – 2010-11-17 13:03:38
是否有何时使用TOUPPER(char)的任何建议,并TOUPPER(焦炭,语言环境)? – kangcz 2010-11-17 13:09:41
@John:固定。/1更多去/ – 2011-08-25 06:21:27