+ 1
So if "int" means integer, why does the program start in int main ()? What does the int before the main signify?
int
2 Antworten
+ 3
The int is just the return type. Every function has a return type, and the return type of the main function is int. If you return 0 at the end of the main function, that means that your program closed without errors. If you return with any other integer that is interpreted as an error code. So if you return 1 in the main function, your program closes with error code 1. Users of your program can use the error code to figure out what's wrong.
+ 1
Okay. Thanks.