Sign in to follow this  
avt

C++ error

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this