std::nouppercase
Defined in header <ios> | | |
|---|---|---|
std::ios_base& uppercase( std::ios_base& str ); | (1) | |
std::ios_base& nouppercase( std::ios_base& str ); | (2) | |
允许在浮点数和十六进制整数输出中使用大写字符.。对输入没有影响。
1%29启用uppercase溪流中的旗子str好像通过打电话str.setf(std::ios_base::uppercase)...
2%29禁用uppercase溪流中的旗子str好像通过打电话str.unsetf(std::ios_base::uppercase)...
这是一个I/O操作程序,可以用表达式调用它,如out << std::uppercase对任何out类型std::basic_ostream或使用表达式,如in >> std::uppercase对任何in类型std::basic_istream...
参数
str | - | reference to I/O stream |
|---|
返回值
str%28操作后对流的引用%29。
例
二次
#include <iostream>
int main()
{
std::cout << std::hex << std::showbase
<< "0x2a with uppercase: " << std::uppercase << 0x2a << '\n'
<< "0x2a with nouppercase: " << std::nouppercase << 0x2a << '\n'
<< "1e-10 with uppercase: " << std::uppercase << 1e-10 << '\n'
<< "1e-10 with nouppercase: " << std::nouppercase << 1e-10 << '\n';
}二次
产出:
二次
0x2a with uppercase: 0X2A
0x2a with nouppercase: 0x2a
1e-10 with uppercase: 1E-10
1e-10 with nouppercase: 1e-10二次
另见
resetiosflags | clears the specified ios_base flags (function) |
|---|---|
setiosflags | sets the specified ios_base flags (function) |
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

