this is the main program
# include "list_3358.h"
# include "stack_3358.h"
# include <iostream>
# include <string>
# include <fstream>
#include <vector>
using namespace std;
using namespace stack;
using namespace linked_list;
int main(int argc,char* argv[])
{
string str;
str=argv[1];
STACK_3358<string> stack1;
//ifstream infile( str );
ifstream file_op( str.c_str() );
do
{
string line,equ;
getline(file_op,line);
vector<string> readline;
readline.push_back(line);
for( int i = 0; i < readline.size() ; i++ )
{
equ=readline;
if( "(" == equ)
{
stack1.push(equ);
}
else if( "{" == equ)
{
stack1.push(equ);
}
else if ( "<" == equ)
{
stack1.push(equ);
}
else if ( "[" == equ)
{
stack1.push(equ);
}
else if(stack1.gettop()==equ)
{
if(!stack1.isempty())
{
stack1.pop();
}
if(stack1.gettop()!=equ)
cout << "Missing"<<equ<<endl;
}
else
return 0;
}
if(stack1.isempty())
cout<<" valid expression"<<endl;
}while(!file_op.eof());
file_op.close();
return 0;
}
and I am getting errors like this
equation_test.cpp: In function `int main(int, char**)':
equation_test.cpp:34: error: no matching function for call to `stack::STACK_3358<std::string>::push(int)'
stack_3358.h:31: note: candidates are: void stack::STACK_3358<Item>::push(Item&) [with Item = std::string]
stack_3358.h: In member function `void stack::STACK_3358<Item>::push(Item&) [with Item = std::string]':
equation_test.cpp:38: instantiated from here
stack_3358.h:32: error: cannot call member function `void linked_list::LIST_3358<Item>::insertAtHead(Item&) [with Item = std::string]' without object
stack_3358.h: In member function `Item stack::STACK_3358<Item>::gettop() [with Item = std::string]':
equation_test.cpp:48: instantiated from here
stack_3358.h:58: error: cannot call member function `Item& linked_list::LIST_3358<Item>::getdata() [with Item = std::string]' without object
stack_3358.h: In member function `bool stack::STACK_3358<Item>::isempty() [with Item = std::string]':
equation_test.cpp:50: instantiated from here
stack_3358.h:47: error: cannot call member function `size_t linked_list::LIST_3358<Item>::getcurrentsize() [with Item = std::string]' without object
stack_3358.h: In member function `void stack::STACK_3358<Item>::pop() [with Item = std::string]':
equation_test.cpp:52: instantiated from here
stack_3358.h:40: error: cannot call member function `void linked_list::LIST_3358<Item>::deleteAtHead() [with Item = std::string]' without object
please help me to solve this.