I see that this question has been answered, but it is not standard. the following code will go through a runtime error in Visual Studios; however, it works fine with g ++.
va_list empty_va_list; CCMenuItemToggle::initWithTarget( this, menu_selector(GOSound::toggleButtonCallback), NULL, empty_va_list );
A better solution would be to create a couple of helper functions that build an empty va_list.
va_list CCMenuItemToggle::createEmptyVa_list() { return doCreateEmptyVa_list(0); } va_list CCMenuItemToggle::doCreateEmptyVa_list(int i,...) { va_list vl; va_start(vl,i); return vl; }
make doCreateEmptyVa_list private, and then when you call the function call
CCMenuItemToggle::initWithTarget( this, menu_selector(GOSound::toggleButtonCallback), NULL, CreateEmptyVa_list() );
source share