Yes :) , the following code will generate
an "dividing by zero" exception
faster for 32bit build:
{
UINT_PTR uiDivider(0);
for (;;) {
UINT_PTR uiResult(4 / ++uiDivider);
}
}
...and this can crash an 64bit execution:
{
class A {
int m_iMember;
public:
A(int i = 0) : m_iMember(i) {}
int GetMmber() const { return m_iMember; }
} a;
A* pA(&a);
DWORD dwPointerStorage = static_cast<dword>(pA);
pA = static_cast<a*>(dwPointerStorage);
pA->GetMember(); }</dword>