QuesHub > C > void > difference > ASK DETAIL

What is the difference between main and void Main 2024?

Noah Baker | 2023-05-05 05:47:20 | page views:1829
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Zoe Thomas

Studied at the University of Johannesburg, Lives in Johannesburg, South Africa.
In C++, both fun() and fun(void) are same. So the difference is, in C, int main() can be called with any number of arguments, but int main(void) can only be called without any argument. Although it doesn't make any difference most of the times, using --int main(void)-- is a recommended practice in C.
2023-05-12 05:47:20

Lucas Parker

QuesHub.com delivers expert answers and knowledge to you.
In C++, both fun() and fun(void) are same. So the difference is, in C, int main() can be called with any number of arguments, but int main(void) can only be called without any argument. Although it doesn't make any difference most of the times, using --int main(void)-- is a recommended practice in C.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4