Error C3867 in C++

后端 未结 3 1053
猫巷女王i
猫巷女王i 2020-12-21 04:38

My code was working fine until I reloaded the program a few hours later. Now I get these this error:

error C3867: \'player::getxPos\': function call miss

相关标签:
3条回答
  • 2020-12-21 04:49

    shotVector[eS-1].initShot(P->getxPos, P->getyPos); - you are trying to call the getxPos() and getyPos() members without ().

    Use getxPos() and getyPos().

    0 讨论(0)
  • 2020-12-21 04:57
    shotVector[eS-1].initShot(P->getxPos(), P->getyPos());
    
    0 讨论(0)
  • 2020-12-21 05:00

    You forgot the parenthesis, which tell the compiler that you want a method call:

    P->getxPos
    

    vs

    P->getxPos()
    

    If you instead used &P->getxPos, that would give you a pointer to the member function itself.

    0 讨论(0)
提交回复
热议问题