The resource loading... loading...

Try{}catch(...) {} in c++ is not working.

Author: lanchaiye, Created: 2017-12-28 14:21:28, Updated:

Try{}catch(...) {} in c++ is not working. So how do you capture all the unknowns?


More

Inventors quantify - small dreamsC++ writing strategies Requires programming level Must be old driver! What's up? C++ exception handling An exception is a problem that occurs during the execution of a program. A C++ exception refers to a special situation that occurs during the execution of a program, such as an attempt to divide by zero. Exceptions provide a way to transfer program control. C++ exception handling involves three keywords: try, catch, throw. throw: When a problem occurs, the program throws an exception. This is done by using the throw keyword. catch: Capture an exception by an exception handler where you want to handle the problem. try: The code symbol in the try block will be activated by a specific exception. It is usually followed by one or more catch blocks. If a block throws an exception, the method of capturing the exception uses the try and catch keywords. The code in the try block is called the protection code. The syntax of the try/catch statement is shown as follows: Try {pos (192,210) } // Protect code }catch ((ExceptionName e1)) {pos (192,210) } // catch the block }catch ((ExceptionName e2)) {pos (192,210) } // catch the block }catch ((ExceptionName eN)) {pos (192,210) } // catch the block I'm not sure. If the try block throws out different exceptions in different situations, this time you can try multiple catch statements to capture different types of exceptions. What's the matter? https://dn-filebox.qbox.me/0a4bacf37fd7abcbcb62af47aa30c99dfa65293d.png

lanchaiyeIt's not hard to figure out if there are other ways to do it, but it's not hard to figure out if there are other ways to do it.

ZeroC++ is generally less used for this, not a scripting language, where exceptional programs should be stopped.