i have this code
Code:#include <stdio.h> #include <iostream> using namespace std; void DisplayMine() { cout <<"dgd"; } struct mine { void (*dd)(void); }; int main() { void (*foo)(int); mine mineTmp[10]; mineTmp[0].dd = &DisplayMine; mineTmp[0].dd; system ("pause"); return 0; }
what i want to do is load differnet pointers to different funtions in an array .
then just call the funtion by going something like mineTmp[1];
its for finite state machine , i figure you can do this some how , can ayone tell me how to do this please