I know that when I write :
int main (int argc, char *argv[])
{
return 0;
}
I could get command line inputs such as files to read input from it. However, what should I do when the input file will be given after compiled. I mean assume that the name of input file inputFile.txt and my code is stored in main.cpp. I'll make following.
g++ main.cpp -o main
./main inputFile.txt
To be able to get inputFile.txt, what should I do?