F
feribiro
Hi,
could you tell me please how it is possible to pass the type of a
class to a function as a parameter, and then initiate a new class of
that type?
class A {...}
class B : public A {...}
class C : public A {...}
void Main()
{
Create(B);
Create(C);
}
void Create(??? param)
{
A *a = new ??param??;
delete a;
}
Thank you very much
could you tell me please how it is possible to pass the type of a
class to a function as a parameter, and then initiate a new class of
that type?
class A {...}
class B : public A {...}
class C : public A {...}
void Main()
{
Create(B);
Create(C);
}
void Create(??? param)
{
A *a = new ??param??;
delete a;
}
Thank you very much