Could someone please take a look at the following code and tell me at which point in the execution of main() does the string "Gonna delete!" get printed to the screen? Does it actually happen only after the closing curly brace of main()?
So it actually happens just before (or at the same time as?!) the last curly brace?
Curly brace is not a part of the code. It denotes end of block scope. You can say that everything what happens at the end of scope (mainly destructor calls) is happening at the closing bracket
Can anything actually happen after the last curly brace?
I am sure that you meant "after main() finishes". Many things happens: destructors for static objects are called, atexit handlers are executed, runtime library finalizes program execution.