/** * teststate.cpp */ #include "state.h" void main() { /** * Create the objects. */ State* state = new ConcreteStateA(); Context context; /** * Configure and use the objects. */ context.setState( state ); context.request(); /** * Clean-up. */ delete state; }