私はこれを理解できないようです、おそらくそれは単純です。顧客クラスがあり、オブジェクトフォームを作成しようとしていますが、機能していませんが、宣言されていない識別子エラーと構文エラーが発生します。識別子c1の前にありません。ありがとう
class Customer{
string customerID;
string list;
public:
Customer(void);
~Customer(void);
string getcustomerID(){
return customerID;
}
string getList(){
return list;
}
void setcustomerID(string x){
customerID = x;
}
void setList(int x){
if(x==1)
list = "bread";
if(x==2)
list = "eggs";
if(x==3)
list = "cheese";
}
};
void checkout(){
srand(time(NULL));
int random = rand() % 3 + 1;
Customer c1;
c1.setcustomerID(0);