home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
099
/
IOSTREAM.ZIP
/
EX_I23.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-07
|
385b
|
24 lines
// EXAMPLE INPUT-23
// HOW TO AVOID OVERFLOWING AN
// ARRAY WHEN INPUTTING A STRING
// WITH THE EXTRACTION OPERATOR
#include <header.h>
const int max = 10 ;
int main()
{
char array[max] ;
cout << "Enter a string: " ;
cin.width(max) ;
cin >> array ;
cout << "You entered: "
<< array
<< '\n' ;
return 0 ;
}