0

When to use 1 int main() 2 void main() 3 main ()

3rd Oct 2016, 9:52 AM
Raj shah
Raj shah - avatar
3 Antworten
+ 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.
3rd Oct 2016, 11:47 AM
Abdul Meyer
Abdul Meyer - avatar
+ 1
2 void main() - generally only used for beginner programs, unless you really don't have to return a value.
3rd Oct 2016, 11:48 AM
Abdul Meyer
Abdul Meyer - avatar
+ 1
3 main() - doesn't have a return type. although in c++ it defaults to int main().
3rd Oct 2016, 11:50 AM
Abdul Meyer
Abdul Meyer - avatar