The following code works fine on my system
#include "Excpt.h"
#include #include "cmath"
#include void main()
{
_controlfp(0, MCW_EM);
float fResult; // Bennet, pg.136
//int x,y;
float x,y;
// x = 5;
// y = 0;
x = 5.0;
y = 0.0;
_try // __try
{
fResult = x/y;
}
//__except (GetExceptionCode() == EXCEPTION_FLT_DIVIDE_BY_ZERO)
_except (GetExceptionCode() == EXCEPTION_FLT_DIVIDE_BY_ZERO)
{
MessageBox(NULL, L"DIVIDE BY ZERO", L"", MB_OK);
}
}
:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]