C++ Manipulator setiosflagsC++ manipulator setiosflags is used to set the format flag specified by parameter mask. When setiosflags is used in an expression out<<setiosflags(mask) or in>>setiosflags(mask), it sets all format flags of the stream out or in as specified by the mask. SyntaxParametermask: mask representing the flags to be set. Return valueThis function returns an object of unspecified type. setiosflags function should only be used as a stream manipulator. Data RacesThe stream object on which it is inserted or extracted is modified and concurrent access to the same stream object may introduce data races. ExceptionsObject is in a valid state, if any exception is thrown. Example 1Let's see the simple example to demonstrate the use of setiosflags manipulator to activate showbase and uppercase flags: Output: 0X64 Example 2Let's see another simple example: Output: +123+1.232300e+02 Example 3Let's see another simple example: Output: 0X2A
Next TopicC++ Manipulator
|