12345678910111213141516171819202122232425262728293031323334353637383940414243444546
//List.h class List { public: List(); List(const List &); ~List(); bool IsEmpty() { return count == 0; }; bool IsFull() { return count == size; }; void Display() const; void Add(const int &); int Subtract(const List & L2); int Find(const int &); friend ostream & operator<<(ostream & out, const List & Org); private: int *L; int size; int count; }; //List.cpp List::List() { cout << "Default constructor invoked" << endl; L = new int[size]; size = 1; count = 0; for (int i = 0; i < size; i++) { L[i] = 0; } } List::~List() { cout << "destructor invoked" << endl; delete[] L; }