Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "MailBox.h"
- #include <iostream>
- #include <String>
- using namespace std;
- MailBox::MailBox()
- {
- }
- MailBox::~MailBox()
- {
- }
- void MailBox::addMail(Mail x) {
- numMail++;
- list.Push(x);
- }
- Mail MailBox::getMail(int index) {
- Stack<Mail> buffer;
- Mail buff;
- for (int i = 0; i < index - 1; i++) {
- buffer.Push(list.Top());
- buffer.Pop();
- }
- buff = list.Top();
- for (int i = 0; i < index - 1; i++) {
- list.Push(buffer.Top());
- buffer.Pop();
- }
- return buff;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement