G
Greg
if I have:
vector<Car*> car;
vector<Car*>::iterator cari;
for(cari = car.begin(); cari != car.end(); cari++)
{
*(cari)->printDetails();
}
where printDetails() is a function in class Car why can I not comple this
code the error?
I get is:
main.cpp: In function `int main()':
main.cpp:75: error: base operand of `->' has non-pointer type `Car'
vector<Car*> car;
vector<Car*>::iterator cari;
for(cari = car.begin(); cari != car.end(); cari++)
{
*(cari)->printDetails();
}
where printDetails() is a function in class Car why can I not comple this
code the error?
I get is:
main.cpp: In function `int main()':
main.cpp:75: error: base operand of `->' has non-pointer type `Car'