Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Why we use int main( ) in some program s in place of void main?
Can any one help me to know this answer !
2 Respostas
+ 3
that's now the standard, from C11
+ 1
This is because the C++ standard requiresĀ main()Ā to returnĀ int.
As you probably know, the return value from theĀ main()Ā function is used by the runtime library as the exit code for the process. Both Unix and Win32 support the concept of a (small) integer returned from a process after it has finished. Returning a value fromĀ main()Ā provides one way for the programmer to specify this value.
If the code runs with no error then 0 is returned by the main()