// created by: Justin C. Miller
// created on: 9-27-2001
// created for: http://www.geocities.com/neonprimetime.geo/index.html
#include
#include
using namespace std ;
int main(){
ofstream my_outfile("myData.dat", ios::out) ; // creates a data file for me to write to
// instead of cout << "Hello World!" << endl ; which outputs to the sceen
my_outfile << "Hello World!" << endl ; // writes output to myData.dat
my_outfile.close() ; // closes myData.dat because i'm done writing to it!
ifstream my_infile("myData.dat", ios::in) ; // opens myData.dat, the one i just wrote Hell
o World! to
char wordOne[6], wordTwo[7] ;
// instead of cin >> wordOne >> wordTwo ; which reads from the keyboard
my_infile >> wordOne >> wordTwo ; // reads from myData.dat
my_infile.close() ; // closes myData.dat because i'm done reading it!
cout << wordOne << " " << wordTwo << endl ;// outputs the words to the screen just to prov
e that it actually worked!
return 0 ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)