What is the difference between int and void?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at Princeton University, Lives in Princeton, NJ
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-07 14:09:45
评论(499)
Helpful(122)
Helpful
Helpful(2)

Benjamin Lewis
QuesHub.com delivers expert answers and knowledge to you.
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.