if i write something like this it works:
Person array_persons[10];
int age=0;
for(int i=0; i<10; i++)
{
cout<<"give age : "<<i<<endl;
cin>>age;
array_persons[i].setAge(age);
}
but when i try to do it with pointers:
Person *array_persons[10];
int age=0;
for(int i=0; i<10; i++)
{
cout<<"- give age : "<<i<<endl;
cin>>age;
array_persons[i]->setAge(age);
}
it doesn't work[although it does compile]??!!
any ideas?
thanks
N.A.