I am interacting with a C program ( main() located in C) with C ++. In some cases, in my code, I want to stop the program. Now I would like to know how can I do this cleanly?
At the moment, I call std::terminate() , but more because of a lack of better ideas. The main thing that bothers me, is not that I do not free up memory (because it is freed from program termination anyway, right?), But the MSVS Just-in-time Debugger pops up and I get an ugly error message ending time execution in an unusual way.
EDIT: since this caused confusion: returning to main() with return 0 is not possible in this case.
c ++ c
fewu
source share