int main()

Hello,

Ive seen int main() written like this, int main(int argc, char *argv[]) or in this fashion a lot, and i was curious what the purpose of writing it like that is, compared to just simply writing int main().

this has just been somthing that has been on my mind a bit, and would appreciate any help as to what the difference and benefit to doing so is,

Thanks,
Sabal
If the program is called with parameters, argc saves the number of parameters and argv saves the parameters.
This was often used for DOS programms but today it's not realy usual.

I hope I could help you.

Greez
BlackMark
It may not be so common for Windows but command line parameters are very common in the world of UNIX. And relatively big number of Windows applications accepts them too, they are not just so commonly used by average end users.
Last edited on
Also in Windows program arguments are important, an example could be when the program is launched when opening a file
Last edited on
Topic archived. No new replies allowed.