I have a program that needs to open a file, parse it line by line, and run some code with those lines. I have the program doing what I want except that it has to prompt for the target file. I need it to get that file from a makefile instead.
The makefile line is:
$(PATH)/program.exe file.txt
What I'm not sure how to do is open file.txt in program.exe. The only way I know to open files in c++ is:
ifsream file;
file.open(some_string_here)
Should I be using something like this: c-comm-line-strings? Just call argv, or is there a better way to do this?
Edit for question clarity: The question I have here is "How do I actually use the command line arguments?" Answer supplied in comments by R Sahu