I complied the code piece below successfully via VC++ 2010
but when I run the exe file ,I found there is an unhandled exception.
But I have my try catch block .why???
#include <iostream>
using namespace std;
class A
{
public:
virtual float GetSum()
{
return 0;
}
};
class B
{
private:
float sum;
public:
B(A a)
{}
B(float b)
{
sum=b*1000;
}
float GetSum()
{
return sum;
}
};
void main()
{
try
{
float f1=1.23;
int tt=f1;
cout<<"tt="<<tt<<endl;