Those some parts of my program. I write the problem at the buttom
void main()
{
string option;
warehouse car[2];
car[0].inputCar("lamborgini",true);
car[0].showCar();
car[1].inputCar("ferrari",false);
car[1].showCar();
//display the choices of the user
cout<<"a) Show number of modified"<<endl;
cout<<"b) Show list of modified"<<endl;
cin>> option;
switch (option[0])
{
case 'a':
countModified();
break;
case 'b':
listModified();
break;
}
}//end main
my function
void listModified()
{
warehouse car[2];
for (i=0;i<2;i++)
{
car[i].printModified();
//cout<<"COUT: "<<car[i].checkModified()<<endl;
}
}
i noticed that i must have warehouse car[2]; to every function i write elsewhere i get the following errors
error C2065: 'car' : undeclared identifier
and
error C2228: left of '.printModified' must have class/struct/union
the problem is that the values change.
any way to fix this ?
Thanks for your time!