0
When to use 1 int main() 2 void main() 3 main ()
3 Réponses
+ 1
1 int main() - user when you what to return a value to indicate the program ran successfully. Or if you want to return a calculated value to a user, such as a randomly generated password.
+ 1
2 void main() - generally only used for beginner programs, unless you really don't have to return a value.
+ 1
3 main() - doesn't have a return type. although in c++ it defaults to int main().