The main function can be called in the following ways in C:
int main() int main(int argc, char *argv[]) Does C support overloading?
Answer to this question is a NO.
Then how can main() be called in C in two ways?
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalThe main function can be called in the following ways in C:
int main() int main(int argc, char *argv[]) Does C support overloading?
Answer to this question is a NO.
Then how can main() be called in C in two ways?
int main(void). An empty parameter list in function definitions is a deprecated feature.int main(void)intoint main(int _Hidden_argc, char *_Hidden_argv[]). Then, even if the ABI does not work with routines called with more arguments than parameters in their definitions, it will not matter sincemainis effectively always defined with two parameters (as shown above) and is called that way (by the run-time startup code). The implementation can similarly transform any calls tomain.