A
Action
Let's say
class parent
class B : parent
class C : parent
....etc. (may add later......so I don't know how many classes will there...)
I wanna to let the user type in the class name and instaniate a new instance
e.g.
string userinput = "classB"
parent temp = new SOMEFUNCTION("classB");
I wanted to ask what can SOMEFUNCTION be???
the point is that I dont' want to do
if (userinput == "classA")
temp = new A();
else if (userinput =="classB")
temp = new B();
....etc.
but rather
temp = new SOMEFUNCTION(userinput); // temp can be A or B or other...
class parent
class B : parent
class C : parent
....etc. (may add later......so I don't know how many classes will there...)
I wanna to let the user type in the class name and instaniate a new instance
e.g.
string userinput = "classB"
parent temp = new SOMEFUNCTION("classB");
I wanted to ask what can SOMEFUNCTION be???
the point is that I dont' want to do
if (userinput == "classA")
temp = new A();
else if (userinput =="classB")
temp = new B();
....etc.
but rather
temp = new SOMEFUNCTION(userinput); // temp can be A or B or other...