Jump to content
  • Advertisement
Sign in to follow this  
avt

C++ error

This topic is 4971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! im having a strange C++ error... this is my AVTMenuManager.h: -------------------------------- typedef struct _menu_item{ std::string title; void (AVTMenuManager::*ptr)(int); } AVTMenuItem; class AVTMenuManager { int _highlighted; int _estado; AVTMenuItem _opcoes[NUM_MENUS][MAX_OPCOES]; int _n_opcoes[NUM_MENUS]; ... this is the invocation (AVTMenuManager.cpp) ------------------------------ 96: void AVTMenuManager::ExecuteAction(int arg){ 97: _opcoes[_estado][_highlighted].ptr(1); 98: } ... this is the error: c:\temp\avt\AVTGL\AVTMenuManager.cpp(97): error C2064: term does not evaluate to a function

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
96: void AVTMenuManager::ExecuteAction(int arg){
97: _opcoes[_estado][_highlighted].ptr(1);
98: }

Should it be this ?

96: void AVTMenuManager::ExecuteAction(int arg){
97: (*_opcoes[_estado][_highlighted].ptr)(1);
98: }

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!