In most cases, int main() does not return anything, it is not even necessary, since no return will not produce an error. So why should the main return an int? Why is the main impossible?
int main()
return
EDIT: I meant why int main () is standard if usually there is no return ?
Other programs may use a return code to determine the success of the application. Zero usually means success.
void is possible, but non-standard. The returned int means something to the caller.
void
int
Just as a function in your program can return values โโto indicate its result, main returns to indicate the result of your program.
main
Also in case int main() returns explicit, the compiler will automatically put return 0
return 0
Because the standard says so. :-P
(Also, duplicate. ;-))
Source: https://habr.com/ru/post/1481392/More articles:MySQL query between two date fields - phpmysql query with HAVING COUNT clause - sqlGet row count from COPY command - plpgsqlHow can you โget back to this revisionโ with a specific revision number from the command line? - command-lineAJAX works if chrome dev tools are open, but not if chrome web tools are closed? - javascriptSDL creates a transparent surface - sdlHTML formatted cell value from Excel using Apache POI - javainnerHTML of the clicked element - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1481396/implementing-generic-repository-using-entity-framework-code-first&usg=ALkJrhhqwouJl4J7Jjsqe3-lQsJ4xENyKgHow to allow softkeyaybord to cover only certain types? - android-layoutAll Articles