ac
and av
are passed as argument to main
function sometimes instead of argc
and *argv[]
.
Do they do the same thing?
ac
and av
are passed as argument to main
function sometimes instead of argc
and *argv[]
.
Do they do the same thing?
The names don't matter, the compiler does not care what they are. The only concern is the typing.
You can call them whatever you want, so long as the types match. Note char** v
and char* v[]
are equivalent to the compiler.
The convention is argc
and argv
which helps your code be more readable and consistent. Unless you have a very compelling reason, stick with that.
Yes; the parameter names of main()
don't matter.
Yes, it's just parameter name, you can name them how you want.
But for the main function, I would rather stick to standard naming (argc, argv) rather than ac / av.