1) since you do not have any methods for your class why use class at all..Use struct.
CODE
struct NameDataSet
{
char firstName[128];
char lastName[128];
int creditCard;
};
2) your function dispalydata() should take an integer variable represeting size in their parameter)...good programming pratice.
3) why are using the string "exit", use something like 'q' to exit...its easier.u dont have to do string compare.
4)i cnt find the function definition of getData()...so i dnt knw waht u r doin in the while loop..but i hv a suggestion
why dont you read in the information before the while loop.example
CODE
int main()
{
cout <<"Read fname";
int index=0;
cin >> nds[index].firstName;
while( index < max && (nds[index].firstName) != 'q') )
{
cout << "last name";
cin >> nds[index].lastName;
cout << "credit info";
cin >> nds[index].creditCard;
cout << "Enter first name for .................
index++;
cin >> nds[index].firstName;
}
its just a suggestion..and you should fix some errors because im jus writing, i dint compile or anytin..jus givn u an idea.
5) back to your code,i hv found ur function getData().... nds is an array, u shud call it with nds[index].firstName inside the function getData()..correct that and u r done
6)