Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ c++;toupper-标准函数?_C++_Cross Platform_Standard Library_C++ Standard Library - Fatal编程技术网

C++ c++;toupper-标准函数?

C++ c++;toupper-标准函数?,c++,cross-platform,standard-library,c++-standard-library,C++,Cross Platform,Standard Library,C++ Standard Library,可能重复: 嗨, 我需要一个便携式函数来把C++中的字符串转换成大写字母。我现在正在使用toupper(char);作用它是标准函数吗?如果没有,跨平台的正确方法是什么?顺便问一下,有没有Web / wiki,我可以列出所有C++标准函数?谢谢。对于后一个问题,有。对于后一个问题,有。嗨,在我们的项目中,我们使用boost/algorithm/string to_upper function project For windows和linux嗨,在我们的项目中,我们使用boost/algori

可能重复:

嗨,
我需要一个便携式函数来把C++中的字符串转换成大写字母。我现在正在使用toupper(char);作用它是标准函数吗?如果没有,跨平台的正确方法是什么?顺便问一下,有没有Web / wiki,我可以列出所有C++标准函数?谢谢。

对于后一个问题,有。

对于后一个问题,有。

嗨,在我们的项目中,我们使用boost/algorithm/string to_upper function project For windows和linux

嗨,在我们的项目中,我们使用boost/algorithm/string to_upper function project For windows和linux

是,
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';
}
#包括
#包括
#包括
#包括
int main()
{
std::string str(“你好”);

std::coutYes,
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';
}
#包括
#包括
#包括
#包括
int main()
{
std::string str(“你好”);

std::您是否需要范围解析运算符?何时使用toupper(char)和何时使用toupper(char,locale)有何建议?您需要范围解析运算符何时使用toupper(char)和何时使用toupper(char,locale)有何建议?