Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 819 Bytes

noshowpos.md

File metadata and controls

46 lines (37 loc) · 819 Bytes

noshowpos

  • ios[meta header]
  • std[meta namespace]
  • function[meta id-type]
namespace std {
  ios_base& noshowpos(ios_base& str);
}

概要

数値出力時に正符号を出力させないことを指示するマニピュレータ。 符号付き整数・浮動小数点数に対して効果がある。

効果

str.unsetf(std::ios_base::showpos)を実行する。

戻り値

実引数のstrオブジェクト。

#include <iostream>

int main()
{
  std::cout << std::showpos << 1 << ' ' << 0 << ' ' << 1 << std::endl;
  std::cout << std::noshowpos << 1 << ' ' << 0 << ' ' << 1 << std::endl;
}
  • std::noshowpos[color ff0000]
  • std::showpos[link showpos.md]

出力

+1 +0 +1
1 0 1

バージョン

言語

  • C++03

参照