我想使用對象接受一個十六進制值到鏈接列表中,並允許用戶添加/乘以列表中的值的基本C++程序。問題是我在我的對象的乘法區域遇到編譯器錯誤。下面的代碼:鏈接列表不匹配運算符*編譯器錯誤
void LList::Multi() {
element new_input;
element temp;
element temp1;
cout << "Please enter the number you would like to multiply." <<endl;
new_input = Read_Element();
temp = head −> data;
temp1 = (temp * new_input);
head −> data = temp1;
}
這裏是我得到的錯誤: LList.cpp:在成員函數void LLIST ::多():LList.cpp:77:錯誤:不對應的運營商*在臨時* new_input
我只使用了<的iostream> < stdlib.h>中和<字符串>庫,任何投入將非常感謝。
你好,@ deadly.foxie。歡迎來到堆棧溢出!什麼是元素? – 2011-05-05 22:00:11