"int main (vooid)"? How does that work? "int main (vooid)"? How does that work? c c

"int main (vooid)"? How does that work?


It's simply using the "old-style" function-declaration syntax; you're implicitly declaring an int parameter called vooid.


It's valid code, because myprog.c contains:

int main (vooid) // vooid is of type int, allowed, and an alias for argc{       return 42; // The answer to the Ultimate Question} 

vooid contains one plus the number of arguments passed (i.e., argc). So, in effect all you've done is to rename argc to vooid.


In C, the default type for a function argument is int. So, your program is treating the word vooid as int main(int vooid), which is perfectly valid code.