1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Stream
A logical structure consisting of a sequence of characters that enables a program to communicate with the outside world.
cout
Standard output stream used by a program to write data to the monitor.
cin
Standard input stream used by a program to fetch data, typically from the keyboard.
endl
A predefined constant equivalent to \n that moves the cursor to a new line.
cin.fail()
Function used to detect if the stream is in an error state.
cin.clear()
Function that restores the stream from an error state to a normal state.
cin.ignore(n)
Function that ignores or skips n characters in the input stream.
Multiple Outputs Syntax
cout << expression1 << expression2 << ...; allows for outputting multiple expressions.
Multiple Inputs Syntax
cin >> var1 >> var2 >> ...; allows for sequential input into multiple variables.
Error handling in input streams
Includes checking the stream state with cin.fail() and clearing the error state with cin.clear().