Why am I not entering in exception in the code below ?
int main()
{
int n_one, n_two;
cout << "enter number one \n";
cin >> n_one;
cout << "enter a zero for causing exception \n";
cin >> n_two;
try {
int result = n_one / n_two;
}
catch (...) {
cout << "Welcome to the exception !!";
}
return 0;
}
I want to use the try/catch handling any kind of exception with catch(...) for another project, how can I make this work ?