c++ - error: no matching function for call to...(std::string&) -
i'm getting following compiler error
error: no matching function call 'infxtree(std::string&)'
for bit of code.
int main(){ string infxstr; cout << "enter infix string: " << endl; cin >> infxstr; prefixoutput(infxtree(infxstr)); postorderoutput(infxtree(infxstr), ' '); displaytree(infxtree(infxstr), infxstr.size()); return 0;
}
i error on last 3 lines. here's function:
template <typename t> tnode<t> infxtree(const string& iexp);
any ideas i'm doing wrong? thanks!
you have give template parameter explicitly:
infxtree<foo>(infxstr)
where foo
class type provided templated tnode
class.
Comments
Post a Comment