1.

Is Using Exit() The Same As Using Return?

Answer»

No. They are not the same. Return statement returns control to the CALLER function, that is, it EXITS from the lowest level of the call stack. Where as, EXIT statement make the program returns to the system from where the application was STARTED. So, exit always exits from the highest level of call stack. Eventually, if there is only one level of function call then they both do the same.

No. They are not the same. Return statement returns control to the caller function, that is, it exits from the lowest level of the call stack. Where as, exit statement make the program returns to the system from where the application was started. So, exit always exits from the highest level of call stack. Eventually, if there is only one level of function call then they both do the same.



Discussion

No Comment Found