Fundamentals of Characters and Strings
•
Reading strings
–
Assign input to character array
word[20]
»
cin >> word
•
Reads characters until whitespace or EOF
•
String could exceed array size
»
cin >> setw( 20 ) >> word;
•
Reads 19 characters (space reserved for
'\0'
)