home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
099
/
IOSTREAM.ZIP
/
EX_I24.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-07
|
452b
|
26 lines
// EXAMPLE INPUT-24
// DEMONSTRATE HOW TO READ IN A
// STRING AND RETAIN WHITESPACE,
// BOTH LEADING AND EMBEDDED
#include <header.h>
const int length = 100 ;
int main()
{
char string [length] ;
const char quote = '\"' ;
cout << "Enter a string: " ;
cin.get(string , length) ;
cout << "Your string: "
<< quote
<< string
<< quote
<< '\n' ;
return 0 ;
}