+ 1
why don't we use void instead of int as a return type for main function?
2 Answers
+ 2
When you write a program , compile it and then run it, it becomes a process. Every process has a return value. While the process is running , one program(operating system) calls another program , so returning some value to the calling program is considered success and also as an exit status. But in void , since we don't return anything and we can't ascertain the exit status of the program , it is usually avoided in most of the compilers .
0
what if we use void return type... will it cause any problem??



