how to exit from a function but not from main()

c, c++, function

Solution

If you are not in `main()` and in other function then also you can call `exit()` or `abort()` it will terminate your whole process.

where `exit()` will do required clean up where `abort()` will not perform that.

Problem

Does C/C++ support terminating a program from a subroutine function i.e not main? So far I only found that exit and abort allow a user to terminate current function or process. If I'm not in main function, is there a way to terminate the whole program?

Original source