A
Ami
Hi All,
I am trying to create a class whose constructor takes Void
parameter and stores it for future reference. It works fine as
expected.
class base
{
public:
base(LPVOID pObj){ //store lpvoid for reference};
virtual ~base(){};
virtual void func1() { printf("Hello from base\n") };
};
When I create another class from above given class and try to create
object from it, it get following error.
error C2664: 'derived::derived' : cannot convert parameter 1 from
'const int' to 'const class derived &'
Reason: cannot convert from 'const int' to 'const class
derived'
No constructor could take the source type, or constructor
overload resolution was ambiguous
class derivedublic base
{
protected:
virtual void func1(){ printf("Hello from Derived\n") };
};
int main()
{
base *nderived= new derived(NULL); //error
}
Please can any one help me to make this working.
Thanks and Regards
I am trying to create a class whose constructor takes Void
parameter and stores it for future reference. It works fine as
expected.
class base
{
public:
base(LPVOID pObj){ //store lpvoid for reference};
virtual ~base(){};
virtual void func1() { printf("Hello from base\n") };
};
When I create another class from above given class and try to create
object from it, it get following error.
error C2664: 'derived::derived' : cannot convert parameter 1 from
'const int' to 'const class derived &'
Reason: cannot convert from 'const int' to 'const class
derived'
No constructor could take the source type, or constructor
overload resolution was ambiguous
class derivedublic base
{
protected:
virtual void func1(){ printf("Hello from Derived\n") };
};
int main()
{
base *nderived= new derived(NULL); //error
}
Please can any one help me to make this working.
Thanks and Regards