我得到以下編譯器錯誤錯誤:調用...(的std :: string&)
error: no matching function for call to 'infxTree(std::string&)'
對於該位的代碼不匹配功能。
int main(){
string infxStr;
cout << "Enter an infix string: " << endl;
cin >> infxStr;
prefixOutput(infxTree(infxStr));
postorderOutput(infxTree(infxStr), ' ');
displayTree(infxTree(infxStr), infxStr.size());
return 0;
}
我得到的所有的最後3行錯誤。這裏的功能:
template <typename T>
tnode<T> infxTree(const string& iexp);
任何想法我做錯了什麼?謝謝!
謝謝!該程序仍然不起作用,但至少現在它編譯,所以我可以嘗試找出原因!多謝。 – Gray