kthouz
- 188
- 0
What is the effect of putting void before main function i mean?
void main()
{
}
void main(void)
{
}
void main()
{
}
void main(void)
{
}
The discussion centers on the implications of using the void keyword before the main function in C programming. Participants explore the syntax, standards compliance, and potential consequences of defining main with a return type of void.
Participants generally agree that the main function should return an integer, but there is contention regarding the permissibility of using void as a return type in C, with some arguing it is nonportable.
The discussion highlights the potential for undefined behavior when using void for main, but does not resolve the nuances of compiler-specific behavior or portability issues.