c++ - Throwing exception and it's messages -
i'm new using clion
, try write simple program understand how works. i'm on windows 8 + cygwin
program is:
int main() { throw std::exception(); }
i got in console output:
c:\....\bin.exe process finished exit code 0
where messages program aborted or else? there nothing, , how should detect if program aborted throwing exception?
this done because don't have try , catch , happens stack unwitted.in function if don't have catch goes down stack until reaches main , if there no catch terminate.if function throw exception without catch terminate imediately , go caller function.if caller function main , don't have catch program terminate.it goes down stack , without catch somewhere in chain of functions terminate program.
Comments
Post a Comment