Created
July 20, 2014 14:27
-
-
Save DimensionalScoop/705e24210fc09cfacbee to your computer and use it in GitHub Desktop.
Intuitive Software Development in C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Ball | |
{ | |
public: | |
Ball() | |
{ | |
std::cout << "Throwing Ball!\n"; | |
} | |
}; | |
int main(int argc, char* argv[]) | |
{ | |
try | |
{ | |
throw Ball(); | |
} | |
catch (Ball) | |
{ | |
std::cout << "caught!"; | |
} | |
std::cin.get(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment