나는이 erorr를 얻을 수있다 : VC++를 -이 선언은 줄에 저장소 클래스 또는 형식 지정자가 없습니다 :VC++는 -이 선언은하지 저장소 클래스 또는 형식 지정
towerControl.push_back() = new Boeing;
누군가가 잘못 무슨 일이 일어나고 있는지 지적 할 수 ? 감사.
#include <iostream>
#include <vector>
using namespace std;
class Aircraft {
public:
virtual void disp() { cout << "I'm an aircraft\n"; }
virtual ~Aircraft() { cout << "Aircraft::Destructor\n"; }
};
class Boeing: public Aircraft {
public:
void disp() { cout << "I'm a Boeing\n"; }
~Boeing() { cout << "Boeing::Destructor\n"; }
};
class Airbus: public Aircraft {
public:
void disp() { cout << "I'm an Airbus\n"; }
~Airbus() { cout << "Airbus::Destructor\n"; }
};
class Tower {
public:
vector <Aircraft*> towerControl;
towerControl.push_back() = new Boeing;
towerControl.push_back() = new Airbus;
~Tower() { cout << "Tower::Destructor\n"; }
};
int main() {
Tower T;
}
필요한 책으로 시작하는 것이 좋습니다. –