Question: Could please more clearly explain by example the defining your own exceptions?
One minute response: Because you can throw a value of any type (except reference types), any type you create can be an exception.
Question: What are standard exceptions? Why is deriving from standard exceptions better? What is minimal compressed path?
One minute response: Standard exceptions are defined in <stdexcept>. Deriving your own exceptions from the standard exceptions takes less work than deriving from the base exception class. A minimal compressed path is a compressed path with no redundant nodes.
Question: Does STL have its own exception [?]? Like if vector is full, does it throw any any exceptions?
One minute response: It depends on the implementation, but the STL throws run-time exceptions for things like .at()
range violations.
Question: Should we use try{} catch{} in our code?
One minute response: You should give it a try.
Question: Can we catch exceptions that are thrown by the operating system. And display the same [?] as thrown by the operating system.
One minute response: The exceptions thrown by the operation system are called signals (for unix-like OSs, anyway) and a program can catch signals, but they use system calls rather than language features.
Question: Can you explain the different types of exceptions, for instance IO exceptions?
One minute response: Unlike Java, there's no fixed differences between C++ exceptions. Any differences that exist are due to conventions, such as logic vs. run-time exceptions. This can make them difficult to distinguish because the meanings are not enforced.
Question: Where do you find the time to conjure up the kind of assignments you do?
One minute response: A lot of the assignment come from things I read (the unshredding assignment was inspired by an article in the New York Times).
This page last modified on 16 July 2003.