Quantcast
Channel: User Zan Lynx - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Answer by Zan Lynx for Do all functions in a c++ program's main function get called regardless of error?

$
0
0

An uncaught C++ exception will terminate the program. Often with a stack trace but that is up to the implementation.

So no, in your example bar() will never be called.

Update: In some situations the optimizer could inline both functions and move some code from bar to the top of main. You would only see this in a debugger though, because anything with side effects cannot be moved like that.


Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>