What really are the valid signatures for main function in C? I know:
int main(int argc, char *argv[])
Are there other valid ones?
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.
The
C11standard explicitly mentions these two:although it does mention the phrase "or equivalent" with the following footnote:
In addition, it also provides for more (implementation-defined) possibilities.
The relevant text (section
5.1.2.2.1, but this particular aspect is unchanged fromC99) states:Note that this is for a hosted environment, the ones you normally see in C programs. A free-standing environment (such as an embedded system) is far less constrained, as stated in
5.1.2.1of that same standard: