//array of pointers to person objects
#include<iostream.h>
class Person
{
protected:
char name[40];
public:
void getname()
{
cout<<"\n Enter name:";
cin.getline(name,40);
}
void putname()
{
cout<<"\n Name="<<name;
}
};
void main()
{
Person*persptr[100];
int n=0;
char choice;
do{
persptr[n]=new Person;
persptr[n]->getname();
n++;
cout<<"\n Enter another(y/n)? ";
cin>>choice;
}while(choice=='y');
for(int i=0;i<n;i++)
{
cout<<"\n Person Number"<<i+1;
persptr[i]->putname();
}
}
**I access microsoft visual c++ 6.0. I'm beginner in learning C++. Error mentioned that my program requires a reinterpret_cast , a c_style cast or function_style cast.**
Anybody can helps me?