const - Difference in C main function declarations -


i'm beginner langage c , i'd know what's difference between this:

int main(int argc, const char * argv[])  

and this:

int main(int argc, char * argv[]) 

i think it's same thing i'm not sure. explain me difference.

thank you

int main(int argc, char * argv[]) correct , must accepted compiler.

int main(int argc, const char * argv[]) may rejected compiler. if compiler accepts behaviour implementation-defined. means compiler must document non-standard signatures of main accepts, , document behaviour of each one.

so, consult compiler's documentation see says parameters of main. reasonable expectation compiler makes form behave same if had int main(int argc, char *__argv[]) { const char **argv = (const char **)__argv; .


Comments