











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












C++ Stream I/O -- Stream Format States
Stream I/O Format State Flags
Using Manipulators & Member Functions
#include
More Input Stream Member Functions
.get ( ) ; Example: char ch ; ch = cin.get ( ) ; // gets one character from keyboard // & assigns it to the variable "ch"
.get (character) ; Example: char ch ; cin.get ( ch ) ; // gets one character from // keyboard & assigns to "ch"
More Input Stream Member Functions
.getline (array_name, max_size) ;
Example:
char name[40] ; cin.getline ( name, 40 ) ; // Gets up to 39 characters // and assigns the string to "name". A // null is inserted at the end of the string. // Note that if a delimiter is found, // it is removed from the stream, but it is // not stored in the character array.
More Input Stream Member Functions
.ignore ( ) ;
Ex:
cin.ignore ( ) ; // gets and discards 1 character
cin.ignore ( 2 ) ; // gets and discards 2 characters
#include