Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Input/output manipulators

      From cppreference.com
      <cpp‎ |io
       
       
       
      Input/output manipulators
      Floating-point formatting
      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)
       

      Manipulators are helper functions that make it possible to control input/output streams usingoperator<< oroperator>>.

      The manipulators that are invoked without arguments (e.g.std::cout<<std::boolalpha; orstd::cin>>std::hex;) are implemented as functions that take a reference to a stream as their only argument. The special overloads ofbasic_ostream::operator<< andbasic_istream::operator>> accept pointers to these functions.These functions (or instantiations of function templates) are the onlyaddressable functions in the standard library.(since C++20)

      The manipulators that are invoked with arguments (e.g.std::cout<<std::setw(10);) are implemented as functions returning objects of unspecified type. These manipulators define their ownoperator<< oroperator>> which perform the requested manipulation.

      Defined in header<ios>
      switches between textual and numeric representation of booleans
      (function)[edit]
      controls whether prefix is used to indicate numeric base
      (function)[edit]
      controls whether decimal point is always included in floating-point representation
      (function)[edit]
      controls whether the+ sign used with non-negative numbers
      (function)[edit]
      controls whether leading whitespace is skipped on input
      (function)[edit]
      controls whether uppercase characters are used with some output formats
      (function)[edit]
      controls whether output is flushed after each operation
      (function)[edit]
      sets the placement of fill characters
      (function)[edit]
      changes the base used for integer I/O
      (function)[edit]
      changes formatting used for floating-point I/O
      (function)[edit]
       
      Defined in header<istream>
      consumes whitespace
      (function template)[edit]
       
      Defined in header<ostream>
      outputs'\0'
      (function template)[edit]
      flushes the output stream
      (function template)[edit]
      outputs'\n' and flushes the output stream
      (function template)[edit]
      controls whether a stream'sbasic_syncbuf emits on flush
      (function template)[edit]
      (C++20)
      flushes a stream and emits the content if it is using abasic_syncbuf
      (function template)[edit]
       
      Defined in header<iomanip>
      clears the specified ios_base flags
      (function)[edit]
      sets the specifiedios_base flags
      (function)[edit]
      changes the base used for integer I/O
      (function)[edit]
      changes the fill character
      (function template)[edit]
      changes floating-point precision
      (function)[edit]
      changes the width of the next input/output field
      (function)[edit]
      (C++11)
      parses a monetary value
      (function template)[edit]
      (C++11)
      formats and outputs a monetary value
      (function template)[edit]
      (C++11)
      parses a date/time value of specified format
      (function template)[edit]
      (C++11)
      formats and outputs a date/time value according to the specified format
      (function template)[edit]
      (C++14)
      inserts and extracts quoted strings with embedded spaces
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/manip&oldid=165311"

      [8]ページ先頭

      ©2009-2025 Movatter.jp