I created a C++ library. I am using it in an iOS application. I thought of handling exceptions in C++ library and in order to test this I created a test scheme and called the c++ function from it. In the c++ function I intentionally wrote erroneous code.
try
{
int i = 0;
int j = 10/i;
}
catch(std::exception &e){
printf("Exception : %s\n",e.what());
}
But the exception is never caught and the application breaks at - int j = 10/i;
Please tell me, how can I add exception handling to my c++ code in this scenario?
Thanks.