Question about int main()

closed account (D3pGNwbp)
Hi.

What does 'int argc, char *argv[]' inside of 'int main()' do?
And is it needed?

Thanks,
Phillip
Last edited on
They are used if you or other program that calls your program want to pass command line parameters to your program. If you run your program without passing any command line parameters then you can define the function simply as

int main()
{
...
}
closed account (D3pGNwbp)
Thanks
Topic archived. No new replies allowed.