Is the return
statement the last statement inside main
or is it possible to write statements after return?
#include
is return statement the last statement inside main or is it possible to write statements after return?
The run time behavior of executing a return
statement is independent of the function. Be it main
or some other other function, when a return
statement is executed, nothing after that is executed in the function.
It is possible to write statements after the return
statement. They are superfluous since they are not executed. A smart compiler might be able to even omit creation of object code corresponding to the statements after the return
statement.