0
我不太確定我的代碼有什麼問題。我收到了一個錯誤,指出「之前預期的不合格id」。令牌在Travel.display()STL顯示輸出
class Travel{
vector <Business> lBusiness;
public:
void display();
};
void Travel::display()
{
vector <Business>::iterator ptr;
for(ptr=lBusiness.begin();ptr!=lBusiness.end();ptr++)
{
(*ptr).display();
}
}
int main{
vector <Business*>addB;
vector<Travel*>addA;
int choice;
cin>>choice;
if(choice==1){
Travel.display();
}
}
Travel.display();''main''怎麼辦? – NathanOliver