class test
{
private:
int _a;
public:
explicit test(int a)
:_a(a)
{
}
void print()
{
cout<<_a<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
test a = 4; // ERROR
test a(3); //必须显式调用
a.print();
return 0;
}
class test
{
private:
int _a;
public:
explicit test(int a)
:_a(a)
{
}
void print()
{
cout<<_a<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
test a = 4; // ERROR
test a(3); //必须显式调用
a.print();
return 0;
}