C++ commandPrint

undo and redo