CB6的问题(希望大家进来帮我看看)……
本人的代码如下(控制台程序):
//---------------------------------------------------------------------------
#include<iostream.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
int a,b;
cin>>a>>b;
try
{
if(b==0)
throw b;
cout<<a/b<<endl;
}
catch (int)
{
cout<<"Error"<<endl;
}
system("pause");
return 0;
}
//-----------------------
这段代码应该不存在问题,我在dev-c++和vc6下试过。可是在CB6(with update4)中,一旦运行throw(即b=0)便出错误代码:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class int with message 'Exception Object Address: 0x9957E2'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
由于本人初学cb,不知是本人操作有误还是cb的bug,希望热心的朋友帮小弟指点一下。谢谢大家