Hi every one,
I got this problem, i need to create classes in c++ by using macros.
Thats what i want:
#define createObject(ty pe) type a;
main(){
string className = "int";
createObject(cl assName);
}
unfortunately it doesnt works with strings i can do it only if i will use actual data type:
createObject(in t);
_______________ _______________ _____
currently i am using VS2005, well of course in theory i can use a lot of if statements or switch, but buy using this method i dont need to add code each time i want to add compatability for some new class.
Thank you very much !
I got this problem, i need to create classes in c++ by using macros.
Thats what i want:
#define createObject(ty pe) type a;
main(){
string className = "int";
createObject(cl assName);
}
unfortunately it doesnt works with strings i can do it only if i will use actual data type:
createObject(in t);
_______________ _______________ _____
currently i am using VS2005, well of course in theory i can use a lot of if statements or switch, but buy using this method i dont need to add code each time i want to add compatability for some new class.
Thank you very much !
Comment