I’ve seen a program that can print itself, like below:
main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
My question is: why can it pass an a without specifying any type into the main function? I know that the arguments for main function is void or argc, argv. So, what does the a mean here?
This is the implicit int feature of C (K&R, C89). If you left out the type,
intwas assumed by the parser. IIRC it is marked obsolete in C99. It also allowed you to write declarations like