|
단순히 나눗셈에서 부모가 0일 경우 예외를 발생시켜 볼려고 하는데요..
에러가 안날거 같은데 throw 던질때 다음과 같은 에러가 발생합니다.
에러 메시지는
Project Project1.exe raised exception class int with message 'Exception Object Adress: 0x966DBE'. Process stopped. Use Step or Run to continue
입니다.
왜 그런건가요??
float __fastcall TForm1::Divide(int a, int b)
{
if(b == 0)
throw 0;
return (float)a/(float)b;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
try
{
Divide(1, 0);
}
catch(int i)
{
ShowMessage("Happen Exception");
}
}
//---------------------------------------------------------------------------
|