... void print(StringTree * t) { cout << "("; if (t!=NULL) { print(t->left); cout << t->data; print(t->right); } cout << ")"; } ... ... else if (command=="p") { print(tree); cout << "\n"; } ...