C++ String to class name -
this question has answer here:
i read file, , based on each line create object of class same name first word of line, require me make "if statement" check each word , create object. there way convert string class name, can that:
string classname = "someclass"; classname obj;
no, can't...
declaration/definitions need known @ compile-time. can achieve runtime-polymorphism building class-hierarchy (and/or interfaces), though.
Comments
Post a Comment