This is my code now
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char* argv[])
{
// set up input file
ifstream lInput; // declare an input file variable (object)
ofstream lOutput;
lInput.open(argv[1], ifstream::binary); // open an input file (binary)
lOutput.open(argv[2], ofstream::binary);
if (!lInput.good())
{
// operation failed
cerr << "Cannot open input file " << argv[1] << endl;
return 2; // program failed (input)
}
lOutput << "test" << endl;
lOutput << "test2" << endl;
My current output is
testtest2
How do I make it to
test
test2
Thankyou for your help
edit: test to "test" and test2 to "test2" edit2: lOutpt to lOutput