Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <exception>
- struct noFileException : public std::exception {
- const char *message() const throw () {
- return "Exception throwed.\n";
- }
- };
- class someClass {
- public:
- someClass() {
- throw new noFileException;
- }
- };
- int main() {
- try {
- someClass *myClass = new someClass();
- }
- catch(noFileException e) {
- printf("exception: %s\n", e.message());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement