class utest
{
public:
utest(int a);
~utest();
};
utest::utest(int a)
{
cout << "init:" << a << endl;
}
utest::~utest()
{
cout << "end" << endl;
}
void main()
{
utest a(0);
utest *b = new utest(0);
delete b;
}
I do get what i expected.
Is that compiler error or is there something i don't know?
why class named function have to have param in order to get call?
Thanks!
//Create variable a of type utest and initialize it using default constructor
utest a;
//Declare function a, taking no arguments and returning utest by value
utest a();