Computer Science, asked by vineetsharma125, 1 year ago

What are stream manipulators?

Answers

Answered by amithks3
0
stream manipulators.

Manipulators are helper functions that make it possible to control input/outputstreams using operator<< or operator>>. The manipulators that are invoked without arguments (e.g. std::cout << std::boolalpha; or std::cin >> std::hex;) are implemented as functions that take a reference to a streamas their only argument.

Answered by smartbrainz
2

The stream manipulators are endl, setprecision, showpoint / noshowpoint, setw, and setfill.

Explanation:

'Manipulators' are operators used to format the output in C++. Stream Manipulators are functions particularly developed to be used in combination with insertion and extraction of stream object operators.

  • endl - This manipulator invokes a newline character. The output stream is also flushed.
  • showpoint / noshowpoint - This manipulator determines whether or not the decimal point to be included in the floating-point representation.
  • setprecision - This manipulator changes floating-point precision.
  • setw - This manipulator will change the width of the subsequent input/output field.  
  • setfill - If a value does not fill a field in its entirety, the character stated in this manipulator argument is used to fill the fields.

Similar questions