Guest User

Untitled

a guest
May 16th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1.   ofstream fontFile;
  2.  
  3.   fontFile.open (fileName, ios::in | ios::out);
  4.   if(fontFile.is_open()) {
  5.     cout << "file " + fileName + " opened\n";
  6.     while(fontFile.good()) {
  7.       string s;
  8.       getline(cin, s);
  9.       cout << s;
  10.       } // fontFile is good
  11.     fontFile.close();
  12.     cout << fileName +" closed";
  13.   } // if file open
  14.   else
  15.     cout << "Failed to open file: " + fileName;
Add Comment
Please, Sign In to add comment