我一直堅持這個程序,我已經創建了一段時間,現在在這個問題上。沒有人真的能夠幫助我。我只想知道如何獲得無效的工作,因爲裏面的變量不能被定義。卡住請幫助。空白未定義標識符
void PoorRating(Questionnaire RatingDetails[], int i){
for(i=0;i<100;i++){
if(RatingDetails[i].Rating >=1 && RatingDetails[i].Rating <=3){
}
cout << "Information: " << endl << "Name: " << Customer[i].Title << " " << Customer[i].Surname;
}
}
int main(){
char AnotherQ;
int largestgroup;
Questionnaire Customer[100];//set an array
int i=0;
do{
cout << "Please enter Customer title: "; cin >> Customer[i].Title;
cout << "Please enter Customer surname: ";cin >> Customer[i].Surname;
cout << "Please Enter Telephone: "; cin >> Customer[i].Telephone;//set to college the customer's telephone number
Customer[i].Telephone=ValidateTelephone(Customer,i); //Continues to ValidateTelehpone number operation
cout << "Please Enter Group Size: "; cin >> Customer[i].Groupsize;
Customer[i].Groupsize=ValidateGroupSize(Customer,i);//Continues to ValidateGroupSize number operation
cout << "Please Enter Rating of meal: "; cin >> Customer[i].Rating;
Customer[i].Rating=ValidateRating(Customer,i);//Continues to ValidateRating operation
cout<<"Do you want to Continue(y/n)? "; cin>>AnotherQ;//Asks if user wants to continue or end program
i++;
} while(AnotherQ=='y' || AnotherQ=='Y');
largestgroup=FindingLargestGroup(Customer, i);
cout << "Largest Group: " << largestgroup << endl;//displays information
CounterRating(Customer ,i);
PoorRating(Customer,i);
system("pause");
return 0;
}
的完整代碼是不必要的,當你嘗試你已經離開的時候,你不必擔心會把東西拿出來,它也有同樣的問題。請閱讀http://stackoverflow.com/help/mcve – chris
順便說一句,你提到了你面臨的問題...... –
你有一個拼寫錯誤。完整的錯誤信息會告訴你錯誤發生在哪一行。學習閱讀它。 – stark