CODE
#include <iostream>
using namespace std;
bool addPerson (PERSON p);
bool getPerson (PERSON &p);
bool findPerson (char *frame, PERSON &p);
bool findPerson (char *frame, char *lName, PERSON &p);
void printBook();
struct PERSON
{
char fName[100];
char lName[100];
}
const int MAXPEOPLE 3
PERSON people[MAXPEOPLE];
int head = 0;
int tail = 0;
bool addPerson (PERSON p)
{
if (head) = MAXPEOPLE)
{
return false;
}
people [head] = p;
head ++;
return true;
}
bool getPerson(PERSON &p)
{
if (head == 0)
return false;
if(tail) = MAXPEOPLE)
{
tail = 0;
}
P= people[tail];
tail ++;
return true;
}
bool findPerson(char *lName, PERSON &p)
{
for (int i=0; i<=head; i++)
{
if(!stricmp(lName, people[i].lName)
{
p = people[];
return true;
}
}
return false;
}
void printBook()
{
for (int i=0; i<=head; i++)
{
cout<<people[i].fName<<endl;
cout<<people[i].lName<<endl;
}
}
int main()
{
PERSON peeps[]= {{"Joe", "Blow"}, {"Sam", "Smith"}, {"Bill","Jones"}};
bool status = addPerson(peeps[0]);
PERSON p;
bool status= getPerson(p);
if (status == true)
cout<<p.lName<<" "<<p.fName;
else;
}
ok heres what I have done so far.. I tried the code and its not working can you go over for it me thnx