//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?

> Error mentioned that my program requires a reinterpret_cast , a c_style cast or function_style cast.**
the code you posted does not give that particular error.
the two errors in your code are
a. #include <iostream.h> is not standard c++. replace this with #include <iostream> and using namespace std; b. main *must* return an int (not void).

when you run the code, there would also be a problem because of whitespaces left in the input buffer after cin>>choice ; . but you could deal with that after getting the program to compile without errors

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.