when i compile this, i get many errors, and i dont know what any of them mean
any help?, im just doing this program for experience
NVM, it works now ----
Code:// file opener, supposed to ask you if you want to //append or clear and start over #include <iostream> #include <fstream> #include <string> using namespace std; int main() { int toggle; string editORnew,thewordnew; string filename; thewordnew = "new"; cout << "whats the file? include extenstion \n"; cin >> filename; cin.ignore(); ofstream a_file (filename.c_str(), ios::app); if(!a_file.is_open()) { cout << "File couldnt be opened"; } else { cout << "file opened \nedit or new?"; cin >> editORnew; if(editORnew == thewordnew) { a_file.close(); ofstream b_file (filename.c_str()); toggle = 1; if(toggle ==1) { if(!b_file.is_open()) { cout << "\nFile unopenable"; } } } else { cout << "\n ok, editing file."; } } if(toggle != 0) { cout << "\n ok, starting file over."; } return 0; }



LinkBack URL
About LinkBacks


