This is the continuation of my previous question, In C++, how to read the contents of a text file, and put it in another text file?
In that, I was able to able to open an input file input.txt
and read it contents successfully,
but now i don't want to hardcode or give the input filename beforehand,
ifstream myfile ("input.txt");
if (myfile.is_open())
but i want to give the input file name later after compiling the program and generating an executable file named test
in the command line, as shown below
./test input.txt
Any suggestions on how to do this ?