+ 1

Help in c++

Help in c++ I am trying to make a funtion that makes a class and the class name should be string that changes, i was able to make the changing string however i don't know how to set the string to the class, whenever i type : Investor str ; it takes str as the name and not the string, how is it possible to set the class to read the content of the string and not as a name

16th May 2020, 7:32 AM
EAOE
EAOE - avatar
3 Answers
+ 3
I believe he wants to create objects of a class where identifier is based on the name in a string. but, i dont think that is possible to do. Maybe he can do it with macros before compile time, but it would not work during runtime. Dennis +1, yes i think so. i had to re-read many times to understand what the question was. Now that I have thought about it, i do not think what he is asking is even possible.
16th May 2020, 1:08 PM
Gen2oo
Gen2oo - avatar
+ 1
Not sure what you mean, maybe some (pseudo) code could illustrate what you mean in a clearer way?
16th May 2020, 12:31 PM
Dennis
Dennis - avatar