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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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(), sincevisn’t of the right type. See What are the valid signatures for C's main() function?