非标准语法; 使用'&'创建指向成员的指针

M.R*_*REB -1 c++

我确定我的功能,但我不知道这个错误的含义

"non-standard syntax; use '&' to create a pointer to member" 
Run Code Online (Sandbox Code Playgroud)

这是我的功能:recherche d'un trajets dans un vector du trajets

int compagnie::rechercher_Trajet(int ind)
{
    for (int i = 0; i < tab_Trj.size(); i++)
    {

        if (tab_Trj[i]->getNum == ind)
            return i;
        return -1 ;
    }

}

class  trajets :
    int getNum() { return numero; }
};
Run Code Online (Sandbox Code Playgroud)

我求你的帮助,thnx

Dav*_*aim 14

好...

if (tab_Trj[i]->getNum() == ind)
Run Code Online (Sandbox Code Playgroud)

你忘记了().

另外,在C++世界中,我建议反对写作for (int...,偏好autosize_t代替int.比较有符号和无符号值可能会导致错误.

PS.在程序中使用非英语语言命名实体是极其常见的.另外,您将下划线约定与较低的驼峰案例惯例混合使用.

我将该功能命名为rescanTargetrescan_target,但不是rescan_Target(我认为是"rechercher_Trajet"的翻译?).