Это сообщение об ошибке (строки 152 и 159):
[Error] no match for 'operator*' (operand type is 'Airport')
Я пишу программу, использующую стек. Класс Аэропорт содержит текущую информацию о заявках на авиабилеты (направление, номер рейса, фамилия и инициалы и дата вылета).
Программа должна обеспечивать хранение всех заявок, добавление заявок в список (массив), удаление заявок и печать всех заявок.
Что может быть не так с этой программой?
#include
using namespace std;
class Airport {
private:
char destination[50];
int flight_number;
string surname_and_initials;
int day, month, year;
public:
// Constructor
Airport();
...
// Print all requests
void getRequests();
};
class Stack {
enum {EMPTY = -1, FULL = 5};
// Array for storing the data
Airport* tickets[FULL + 1];
int top;
public:
// Constructor
Stack();
void Clear();
bool IsEmpty();
bool IsFull();
int GetCount();
// Add request to array (list)
void Push(Airport* person[]);
// Removing requests
Airport* Pop();
};
// ------------------------------------- Class Stack -------------------------------------
// Constructor
Stack::Stack() {
top = EMPTY;
}
void Stack::Clear() {
top = EMPTY;
}
bool Stack::IsEmpty() {
return top == EMPTY;
}
bool Stack::IsFull() {
return top == FULL;
}
int Stack::GetCount() {
return top + 1;
}
// Add request to array (list)
void Stack::Push(Airport* person[]) {
if (!IsFull())
tickets[++top] = person[++top];
}
// Removing requests
Airport* Stack::Pop() {
if (!IsEmpty())
return tickets[top--];
}
// ------------------------------------ Class Airport ------------------------------------
// Constructor
Airport::Airport() {
cout > destination;
cout > flight_number;
cout > surname_and_initials;
cout > day;
cout > month;
cout > year;
cout
Подробнее здесь: https://stackoverflow.com/questions/797 ... ass-name-c