#ifndef DYNINTSTACK_H
#define DYNINTSTACK_H
class DynIntStack
{
private:
// Structure for stack nodes
struct StackNode
{
int value; // Value in the node
StackNode *next; // Pointer to the next node
};
StackNode *top; // Pointer to the stack top
public:
// Constructor
DynIntStack()
{ top = NULL; }
// Destructor
~DynIntStack();
// Stack operations
void push(int);
void pop(int &);
bool bracketsame(char,char);
bool balancedparantheses(string); //checks if parentheses are
bool isEmpty();
};
#endif
You need to declare the balancedparantheses (nice spelling there) function before main:
1 2 3 4 5 6
#include ...
bool balancedparantheses(string) ;
int main()
{ ...
Note that the functions you have defined are not related to the member functions of the same name declared in the definition of DynIntStack, and that there is no stack type visible to the compiler in said function, although you try to use it on line 29.