In C++, the ellipsis catch handler is really quite simple. All it does is catch any unhandled exceptions. So, the ellipsis catch handler acts as a backup or last resort when no other handlers are appropriate. Here’s an example of what the ellipsis catch handler would look like:
try{ throw "Something";}// the ellipsis catch handler:catch(...){cout << "There's no appropriate handler for this scenario";}
The reason should be fairly obvious - it's the "...", which is also referred to as an ellipsis, and commonly used to mean something like "et cetera".
Would you like to thankProgrammerInterview.com for being a helpful free resource?Then why not tell a friend about us, orsimply add a link to this page from your webpage using the HTML below.
Link to this page:
Please bookmark with social media, your votes are noticed and appreciated: