stack<void*> g_stack; bool stack_push(void (*Function)()) { if (Function != nullptr) { g_stack.push(Function); return true; } return false; } void stack_pop(void) { g_stack.pop(); } bool stack_process(void) { if (g_stack.top() == nullptr) return false; void *f = g_stack.top(); return true; } void Func1() { cout << "1" << std::endl; stack_pop(); }
I'm pushing some function pointers on the stack I want to get the top and call that function I'm pushing for example Func1() on the stack void *f = g_stack.top(); how do I call it ?
2.1m questions
2.1m answers
60 comments
56.9k users