我想測量儲蓄作爲一個學校項目的例子,我真的不知道我做錯了什麼當然添加if語句裏面的功能將無法正常工作,因爲它不能調用自身什麼是「[錯誤]預期不合格-ID之前'如果'」意思是在這個代碼塊
#include <iostream>
using namespace std;
int main(){
struct worker{
int salary;
float taxperc;
int bills;
int home_needs;
int bonus;
bool measure;
void saving(){
float tax = (salary/100)*taxperc;
cout << salary - tax -bills-home_needs << endl;
}
if (measure)
saving();
};
worker me = {50000, 2.5, 150, 3000, 0, true};
}
[The Definitive C++ Book Guide and List](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)。 – molbdnilo