im supposed to create an address book and so far have gone as far as getting the input..my problem now is the highlighted section..i have to return bak the info put in initially by the user (first, last name and address), based upon a question to the user to input either the last name or the first and last name of the persons he wants to pull up. would appreciate some help
thnx
#include <iostream>
const int maxpeople = 50;
struct person
{
char firstname[20];
char lastname[20];
char address[20];
};
void addpeople(person holdspeople[], int size);
void getperson(person holdspeople[maxpeople], int size, int stringsize);
using namespace std;
person people[10];
int main()
{
addpeople(people, 10);
getperson(people, 10, 20);
return 0;
}
void addpeople(person holdspeople[maxpeople], int size)
{
for(int i = 0;i < size; i++)
{
cout<<"Enter your first name, last name and address respectively"<<endl;
cin>>holdspeople[i].firstname>>holdspeople[i].lastname>>holdspeople[i].address;
}
}
void getperson(person holdspeople[maxpeople], int size, int stringsize)
{
char firstname[20];
char lastname[20];
[B]for (int i = 0; i < stringsize; i++)
{
firstname[i] = holdspeople[i].firstname;
lastname[i] = holdspeople[i].lastname;
}[/B]
}