std:: showpos, std:: noshowpos
|
헤더 파일에 정의됨
<ios>
|
||
|
std::
ios_base
&
showpos
(
std::
ios_base
&
str
)
;
|
(1) | |
|
std::
ios_base
&
noshowpos
(
std::
ios_base
&
str
)
;
|
(2) | |
음수가 아닌 정수 출력에서 더하기 기호 '+' 표시를 활성화하거나 비활성화합니다. 입력에는 영향을 미치지 않습니다.
이것은 I/O 조작자이며, 다음과 같은 표현식으로 호출될 수 있습니다:
out
<<
std
::
showpos
std::basic_ostream
타입의 모든
out
에 대해, 또는 다음과 같은 표현식으로 호출될 수 있습니다:
in
>>
std
::
showpos
std::basic_istream
타입의 모든
in
에 대해.
목차 |
매개변수
| str | - | I/O 스트림에 대한 참조 |
반환값
str (조작 후 스트림에 대한 참조).
예제
#include <iostream> int main() { std::cout << "showpos: " << std::showpos << 42 << ' ' << 3.14 << ' ' << 0 << '\n' << "noshowpos: " << std::noshowpos << 42 << ' ' << 3.14 << ' ' << 0 << '\n'; }
출력:
showpos: +42 +3.14 +0 noshowpos: 42 3.14 0
참고 항목
|
지정된 ios_base 플래그를 지움
(함수) |
|
지정된
ios_base
플래그를 설정함
(함수) |