   Functions in Arrays Possible???
  Hello,I can declare something like;float numbers[45] for an array of 45 numbers;is there a way to do something likeCALLBACK functions[12] (HWND,UINT,WPARAM,LPARAM)to be able to just call;functions[X] (arg,arg,arg,arg)maybe some elaboration will prove helpfull.I have a lot of callback functions and like to make it more over overseeableNOTCALLBACK call1 (HWND,UINT,WPARAM,LPARAM);CALLBACK call2 (HWND,UINT,WPARAM,LPARAM);CALLBACK call3 (HWND,UINT,WPARAM,LPARAM);etcBUTCALLBACK call[0] (HWND,UINT,WPARAM,LPARAM);CALLBACK call[1] (HWND,UINT,WPARAM,LPARAM);CALLBACK call[2] (HWND,UINT,WPARAM,LPARAM);etcso not only calling the pointers in array-like fashion,But also declaring them in that waythanxs in advance[Edited by - Kincaid on June 2, 2006 4:48:20 AM]
  id guess you'd want an array of function pointers then..should look something like this i thinkCALLBACK (void*) (HWND,UINT,WPARAM,LPARAM) functions[12];CALLBACK mycoolfunction(HWND h,UINT ui, WPARAM wp, LPARAM lp);function[0] = (&mycoonfunction);someone else please fix this :)   ;  or maybe it should look like this ...CALLBACK (*functions)(float, char, char)[12];   ;  Everything you ever wanted to know about arrays of function pointers: Array of function pointers.   ;  That's what I tried two, but it doesn't workvoid (*functions)(arg,arg)[12]; is the best I have done buterror C2090: function returns arrayalso, it gives problems when using non-primitive typecasts like callback (posted a nother question of that)Thanx anyway   ;  okit should be void ( *functions[12] )( arg, arg );but CALLBACK( *functions[12] )( arg, arg );still doesn't work   ;  It needs a return type, which CALLBACK isn't.Try:typedef LRESULT(*functype)(HWND,UINT,WPARAM,LPARAM);functype functions[12];   ;  CALLBACK is the calling convention and thus should go inside the first pair of parentheses:LRESULT (CALLBACK * functions[12])(HWND, UINT, WPARAM, LPARAM)Σnigma   