need help with int main(int argc, char *argv[])

is there a way to pass values from command line to the int argc and char* argv[] arguments of int main()?
Last edited on
closed account (S6k9GNh0)
I'm not sure I understand. That's the whole point of those parameters. When a program is executed the OS sends console parameters to the entry function, which is main in this case.

"myprogram arg1 arg2"

in this case, argc would be 3, argv[0] would be myprogram, argv[1] would be "arg1" and argv[2] would be "arg2".
Topic archived. No new replies allowed.