Please explain how the following snippet of code in C is a valid one
int main(c, v) char *v; int c;{
//program body
}
I stumbled across some examples from the International Obfuscated C code contest and i'm just curious.
It's K&R-style function declaration. See Function declaration: K&R vs ANSI
However, I don't believe it has a valid signature for main()
, since v
isn't of the right type. See What are the valid signatures for C's main() function?
It's the pre-ANSI style of function declaration, if you're referring to why the char*v; int; is outside of the parentheses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With