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
Code:
// trying and catching
#include <iostream>
using namespace std;
const int DefaultSize = 10;
int main()
{
int top = 90;
int bottom = 0;
try
{
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;
return 0;
}
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?
I read some other threads in this forum, but I didn' t found an answer to this question.
Thanks.