Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write what you understand by given points in one paragraph. A stream in C + + is an infinite sequence of characters from a source
Write what you understand by given points in one paragraph.
A stream in is an infinite sequence of characters from a source to a destination.
An input stream is a stream from a source to a computer.
An output stream is a stream from a computer to a destination.
cin, which stands for common input, is an input stream object, typically initialized to the standarid input device, which is the keyboard.
cout, which stands for common output, is an output stream object, typically initialized to the standard output device, which is the screen.
When the binary operator is used with an input stream object, such as cin, it is called the stream extraction operator. The leftside operand of must be an input stream variable, such as cin; the rightside operand must be a variable.
When the binary operator is used with an output stream object, such as cout, it is called the stream insertion operator. The leftside operand of must be an output stream variable, such as cout; the rightside operand of must be an expression or a manipulator.
When inputting data into a variable, the operator skips all leading whitespace characters.
To use cin and cout, the program must include the header file iostream.
The function get is used to read data on a characterbycharacter basis and does not skip any whitespace characters.
The functiot ignore is used to skip data in a line.
The function putback puts the last character retrieved by the function get back into the input stream.
The function peek returns the next character from the input stream but does not remove the character from the input stream.
Attempting to read invalid data into a variable causes the input stream to enter the fail state.
Once an input failure has occurred, you use the function clear to restore the input stream to a working state.
The maniptiator fixed outputs floatingpoint numbers in the fixed decimal format.
The manipulator showpoint outputs floatingpoint numbers with a decimal point and trailing zeros.
In singlequote mark is digit separator.
The manipulator setw formats the output of an expression in a specific number of columns; the default output is rightjustified.
If the number of columns specified in the argument of setw is less than the number of columns needed to print the value of the expression, the output is not truncated and the output of the expression expands to the required number of columns.
The manipulator setfill is used to fill the unused columns on an output device with a character other than a space.
If the number of columns specified in the setw manipulator exceeds the number of columns required by the next expression, the output is rightjustified. To leftjustify the output, you use the manipulator left.
To use the stream functions get, ignore, putback, peek, clear, and unsetf for standard IO the program must include the header file iostream.
To use the manipulators setprecision, setw, and setfill, the program must include the header file iomanip.
The header file fstream contains the definitions of ifstream and ofstream.
For file you must use the statement #include fstream to include the header file fstream in the program. You must also do the following: declare variables of type ifstream for file input and of type ofstream for file output and use open statements to open input and output files. You can use get, ignore, peek, putback, or clear with file stream variables.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started