Take the input & output file name from the command line...

Beginner here. Working on a program that can be run by the command:

"Aprog inputfilename outputfilename"

Make the program run, then take the 'inputfilename' and 'outputfilename' and use those file names as usable variables in my program.

What's the best way to go about this? Any help is greatly appreciated.
There's only one way:
1
2
3
int main(int argc,char **argv){
    //argv[1] is the first parameter; argv[2] is the second.
}
Topic archived. No new replies allowed.