关于整数和小数的迷惑,大侠来帮下忙
#include <iostream>using namespace std;
class A
{
float x,y;
public:
A(float a ,float b)
{
x=a;
y=b;
}
void display()
{
cout<<x<<endl<<y<<endl;
}
};
int main()
{
A *pal=new A(3.0,5.0);
pal->display();
return 0;
}
我要输出 3.0和5.0 为什么运行结果是3和5呢?
