Hey, I'm helping my friend with this program. Two problems:
1. Is there an escape character in C++ to ignore a \ in a path?
for example in Perl I would just use another \ as in C:\\Progra~1\
2. I need to copy all contents from one file and output to another, but the .get and .put aren't working. Is there a better way to do this or does the syntax need to be corrected?
Thanks for your helpCode:#include <iostream> //i/o library #include <string> // string library #include <fstream> // both input/output files #include <cstdlib> using namespace std; int main() // starting main function { ifstream myinputfile; // declaring input file ofstream myoutfile; // declaring output file cout << "Begin file Copy\n"; // print to screen myinputfile.open ("C:|myinputfile.txt"); //opening input file if (!myinputfile) // testing success { cout << "Error!!\n"; // if unsuccessful } myoutfile.open ("C:|myoutfile.txt"); //opening output file if (!myoutfile) //testing success { cout << "Error!!\n"; // if unsucessful exit (100); } int line; // declaring a variable while (myinputfile.get (line)) { myoutfile.put (line); } myinputfile.close (); // closing input file myoutfile.close (); // closing output file cout << "End file copy\n"; // print to screen exit (102); return 0; // end of main function }