Error C3867 in C ++

My code worked fine until I reloaded the program after a few hours. Now I get this error:

error C3867: 'player :: getxPos': list of calls to missing arguments; use '& player :: getxPos' to create a pointer to a member

error C3867: 'player :: getyPos': list of calls to missing arguments; use '& player :: getyPos' to create a pointer to an element

This is the code in question:

if (P->shoot())
{
    shotVector.push_back(shot());
    eS = shotVector.size();
    shotVector[eS-1].initShot(
        P->getxPos, // C3867
        P->getyPos // C3867
    );
}

I am trying to call two functions from a class called player, and these two functions look like this:

int player::getxPos(){
    return xPos;
};

int player::getyPos(){
    return yPos;
};

What is being done is that I try to ask the position of the players, and then use this to decide what to shoot with.

+3
3

shotVector[eS-1].initShot(P->getxPos, P->getyPos); - getxPos() getyPos() ().

getxPos() getyPos().

+20

, , :

P->getxPos

P->getxPos()

&P->getxPos, -.

+5
shotVector [eS-1] .initShot (P-> getxPos (), P-> getyPos ());
+1
source

Source: https://habr.com/ru/post/1770560/


All Articles