added sample code for exception handling in c++