c++ qsort error with Pointer to a function (the compar)
i have simple c++ class where there i need to do sort array , here is what
i have :
void GameController::sortArray(CCArray *&sameRowGemArray)
{
qsort(sameRowGemArray->data->arr, sameRowGemArray->data->num,
sizeof(long), &GameController::comperator);
}
int GameController::comperator(const void * a, const void * b)
{
/*
..didn't implement logic first i need it to compile
*/
return 1;
}
but im getting compilation error that say :
error C2664: 'qsort' : cannot convert parameter 4 from 'int (__thiscall
GameController::* )(const void *,const void *)' to 'int (__cdecl *)(const
void *,const void *)'
isnt it pointer to function in the where is the comperator?
No comments:
Post a Comment