int main(int argc, int **argv)
Using arguments of main
, you should know the first argument argv[0]
is the name of current executing file, and the following arguments are the parameters sent to your program.
In your case, you must read argv[1]
.
Always check argc
to count the entered arguments.