Namespaces
Variants

std:: uppercase, std:: nouppercase

From cppreference.net
< cpp ‎ | io ‎ | manip
Input/output manipulators
Floating-point formatting
Integer formatting
Boolean formatting
Field width and fill control
Other formatting
uppercase nouppercase
Whitespace processing
Output flushing
Status flags manipulation
Time and money I/O
(C++11)
(C++11)
(C++11)
(C++11)
Quoted manipulator
(C++14)
헤더에 정의됨 <ios>
std:: ios_base & uppercase ( std:: ios_base & str ) ;
(1)
std:: ios_base & nouppercase ( std:: ios_base & str ) ;
(2)

부동 소수점 및 16진수 정수 출력에서 대문자 사용을 가능하게 합니다. 입력에는 영향을 미치지 않습니다.

1) 스트림 str 에서 uppercase 플래그를 활성화합니다. 마치 str. setf ( std:: ios_base :: uppercase ) 를 호출하는 것처럼 동작합니다.
2) 스트림 str 에서 uppercase 플래그를 비활성화합니다. 마치 str. unsetf ( std:: ios_base :: uppercase ) 를 호출한 것처럼 동작합니다.

이것은 I/O 조정자이며, 다음과 같은 표현식으로 호출될 수 있습니다: out << std :: uppercase out std::basic_ostream 타입인 경우, 또는 다음과 같은 표현식으로 호출될 수 있습니다: in >> std :: uppercase in std::basic_istream 타입인 경우.

목차

매개변수

str - I/O 스트림에 대한 참조

반환값

str (조작 후 스트림에 대한 참조).

예제

#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

참고 항목

지정된 ios_base 플래그를 지움
(함수)
지정된 ios_base 플래그를 설정함
(함수)