Yes there is, since there is no statement called exit
. I guess you mean the function exit?
In that case, there is a big difference: The exit
function exits the process, in other words the program is terminated. The return
statement simply return from the current function.
They are only similar if used in the main
function.