Ok so im trying to implement a stack using vectors in C++
i just want to know if the following implementation code makes sense, this is just the implementation file, the client file is working fine but when i run the program it doesnt work so i believe it has to do something wit the implementation file below. what the client program suppose to is let the user enter a postfix notation and the program will evaluate the result. Please any help
#include<iostream>
#include "stackV.h"
using namespace std;
stack::stack()
{
maxsize = 100;
currsize = 0;
}
stack::~stack()
{
clearIt();
}
bool stack::pop(el_t &)
{
if(!isEmpty())
{
el.erase(el.begin() + 0);
currsize--;
return true;
}
}
void stack::push(el_t n)
{
if(!isFull())
{
el.insert(el.begin() + 0,n);
currsize++;
}
}
el_t stack::topElem(el_t &n)
{
if(!isEmpty())
return el[0];
}
bool stack::isFull()
{
return false;
}
bool stack::isEmpty()
{
return(currsize == 0);
}
void stack::displayAll()
{
for(int i = 0; i < el.size(); i++)
cout << el[i] << " " ;
}
void stack::clearIt()
{
}