hey, i am currently working on modifying a program that originally used a stack array to store values. I am modifying it to use a linked list instead of a fixed-size array. I completley understand the concept of a linked list, but i really don't know how to implement them into my program, and change the array to a linked list. i am hoping someone would please point me in the right direction

. thank you. i didn't include main(), its self explanitory.
#ifndef _CLASSES_H
#define _CLASSES_H
class STACK
{
private:
int top;
double stack[20];
public:
STACK(); //Constructor
~STACK(); //Destructor
void push(double x);
double pop();
bool isEmpty() //if top is empty, return true, and do not execute 'pop'
{
if(top==-1){
return true;
}else{
return false;
}
}
double current ()
{
return stack[top+1];
}
};
class RPN: public STACK
{
public:
RPN(); //Constructor
void add();
void sub();
void mult();
void div();
};
#include "membermethods.cpp"
#endif
---------------------------------------------------------------------
#include "classes.h"
//RPN Constructor
RPN::RPN()
{
}
//Calculator functions
void RPN::add()
{
double first=0, second=0, ans=0;
first = pop();
second= pop();
push(first + second);
ans=first+second;
cout<<"\nResult of addition: " <<ans<<endl<<endl;
}
void RPN::sub()
{
double first=0, second=0, ans=0;
first = pop();
second= pop();
push(first - second);
ans=first-second;
cout<<"\nResult of subtraction: " <<ans<<endl<<endl;
}
void RPN::mult()
{
double first=0, second=0, ans=0;
first = pop();
second= pop();
push(first * second);
ans=first*second;
cout<<"\nResult of multiplication: " <<ans<<endl<<endl;
}
void RPN::div()
{
double first=0, second=0, ans=0;
first = pop();
second= pop();
push(first / second);
ans=first/second;
cout<<"\nResult of division: " <<ans<<endl<<endl;
}
//Default Constructor
STACK::STACK()
{
top=-1;
for(int i=0;i<20;i++)
{
stack[i]=0;
}
}
//'Push' member method
void STACK::push (double x)
{
top++;
stack[top] = x;
}
//'Pop' member method
double STACK::pop ()
{
double x = stack[top];
top--;
return x;
}
//Destructor
STACK::~STACK()
{
delete []stack;
}
This post has been edited by Quiksilver: 2 Apr, 2006 - 09:33 AM