I am doing a simple test and when I try to call the member from the class that I created it says that the member isn't of the class type specified. I have called it for the class but I'm still getting the error.
Code:
#ifndef INFIX_CONVERTER_H
#define INFIX_CONVERTER_H
#include <stack>
#include <map>
#include <string>
/*
Precondition for this converter must be that all input is correct
infix input must consist of digits 0-9 and operators +, -, *, /.
*/
class InfixConverter
{
std::map<char, int> prec; //the precendence values of operators
public:
InfixConverter();
~InfixConverter() {}
std::string toPost(std::string&);
};
#endif
test
Code:
#include <iostream>
#include "Stack.h"
#include "InfixConverter.h"
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main(int argc, char *argv[])
{
InfixConverter postServe();
cout << postServe.toPost("2+3+4*5^4") << endl;
return 0;
}