I work in Visual Studio 2010 using C ++ code. What I'm trying to do is change the value of the preprocessor directive at runtime, not sure if this is possible, but I tried this.
somefile.h
static int mValue = 0; #define POO = mValue; ... #if POO 0 //define class methods #else //define class methods differently }
main.cpp
main() { //Code calls constructor and methods allowed when POO is 0 //Code increments mValue //Code calls constructor and methods allowed when POO is 1 }
How can I change POO so that class objects use a different implementation of other methods? Or, if this is not possible, what is the other approach to this?
source share