home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
099
/
IOSTREAM.ZIP
/
EX_F02.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-07
|
575b
|
33 lines
// EXAMPLE FILEIO-02
// GIVE THE USER A CHANCE TO APPEND
// RECORDS TO THE FILE
#include <header.h>
const int max = 100 ;
////////////////////////////////////
int main()
{
char buffer[max] ;
ofstream file_out("OUTPUT.DAT" , ios::out | ios::app) ;
if (!file_out)
{
cout << "OPEN FAILED\n" ;
PAUSE() ;
exit(1) ;
}
cout << "Enter a line of data: " ;
while (!cin.get(buffer , max).eof\())
{
file_out << buffer << endl ;
cout << "Next line: " ;
cin >> FLUSH ;
}
return 0 ;
}