是int
一个class
?
请考虑以下代码
#include"iostream"
using namespace std;
class test{
public:
int a;
test(int x)
{
cout<<"In test Constructor"<<endl;
a = x;
}
};
int main()
{
test *obj = new test(10);// Constructor get called
int *x = new int(10); // Expecting the same if "int" is a class
return 0;
}