ASAP!!! Which stream function can be used to ignore certain number of characters from the input stream?
Group of answer choices
1. cin.getline
2. getline
3. ci.get
4. getche
5. cin.ignore
The correct option is Option (5) cin.ignore. This function is used to ignore or clear characters from input buffer/stream.
- cin.getline is used to read unformatted set of characters from the keyboard. It reads complete string until a null match.
- getline function extracts characters from the input stream and appends it to the string object until the delimiting character is encountered.
- getche is a function which waits for any character input and shows the input character on the output screen.
Hence option (5) cin.ignore is the correct answer.
Get Answers For Free
Most questions answered within 1 hours.