如何在下面的代码中对对象进行显式初始化...
#include"iostream"
using namespace std;
class per{
char *name;
int a;
public:
per(int x = 0,char *str = 0):a(x),name(str){}
char* get()
{
return name;
}
};
int main()
{
per obj(100,"test"); // works fine
// now if i want a explicit initialization for above how will i do?
// example -- per obj = (100,"test");
// but i am getting error or may be not aware how to use
return 0;
}