Namespaces
Variants

std:: showpoint, std:: noshowpoint

From cppreference.net
< cpp ‎ | io ‎ | manip
Input/output manipulators
Floating-point formatting
showpoint noshowpoint
Integer formatting
Boolean formatting
Field width and fill control
Other formatting
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 & showpoint ( std:: ios_base & str ) ;
(1)
std:: ios_base & noshowpoint ( std:: ios_base & str ) ;
(2)

부동 소수점 출력에서 소수점 문자를 무조건 포함할지 여부를 설정하거나 해제합니다. 입력에는 영향을 주지 않습니다.

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

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

소수점 문자로 사용할 문자는 출력 시점에 스트림에 임뷰드된 로캘의 numpunct 패싯에 의해 결정되며, 이는 std::num_put::put 에 설명된 바와 같습니다.

목차

매개변수

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

반환값

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

예제

#include <iostream>
int main()
{
    std::cout << "1.0 with showpoint: " << std::showpoint << 1.0 << '\n'
              << "1.0 with noshowpoint: " << std::noshowpoint << 1.0 << '\n';
}

출력:

1.0 with showpoint: 1.00000
1.0 with noshowpoint: 1

참고 항목

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