This question is not about SEH and is not homework.
I'm reading the book "Teach yourself c++ in one hour a day".
Here we have a simple code here from the book
That code compiled with mingw32 4.5.2 crashes. Compiling it with ms VC++ express 2010 gives the correct answer. What is wrong here? What am I missing with mingw32?
// trying and catching
using namespace std;
const int DefaultSize = 10;
int top = 90;
int bottom = 0;
cout << "top / 2 = " << ( top / 2 ) << endl;
cout << "top divided by bottom = ";
cout << ( top / bottom ) << endl;
cout << "top / 3 = " << ( top / 3 ) << endl;
catch ( ... )
cout << "something has gone wrong!" << endl;
cout << "Done." << endl;
I read some other threads in this forum, but I didn' t found an answer to this question.