:chomp: Hey guys i have an address book that needs to work. I have a header file, but my program says missing header file. here is my code for the program:
Header Code: My header is called "addressboo k.h"
WHY AM I GETTING THIS ERROR?
Code:
#include <iostream>
#include "addressbook.h"
using namespace std;
struct PERSON
{
char fName[25];
char lName[25];
char email[25];
};
PERSON addresses[MAXADDRESS]:
const int MAX_ADDRESSES = 25;
int counter = 0;
int counter2 = 0;
PERSON addresses[MAX_ADDRESSES];
void addPerson(PERSON &p);
void getPerson(PERSON &p);
int main()
{
PERSON pn, test;
bool command;
int selection;
for(;;)
{
cout << "1. Add person" << endl;
cout << "2. Get Person" << endl;
cout << "0. Exit" << endl;
cin >> selection;
switch(selection)
{
case 1:
cout << "Enter your first Name, and last name" << endl;
cin >> pn.fName >> pn.lName;
cout << "Enter your Email Address" << endl;
cin >> pn.email;
addPerson(pn);
getPerson(test);
case 2 :
cout << test.fName << " " << endl;
cout << test.lName << "\n " << endl;
cout << test.email << "\n\n" << endl;
return 0;
case 0:
exit(0);
}
}
}
void addPerson(PERSON &p)
{
if(counter < MAX_ADDRESSES)
addresses[counter++] = p;
else
cout << "Address Book is Full.\n" << endl;
}
void getPerson(PERSON &p)
{
if(counter2 == 0)
counter2 = counter;
p = addresses[--counter];
}
Code:
#ifndef double_H
#define double_H
class double
{
private:
}
public:
{
void addPerson(PERSON &p)
{
addPerson(pn);
}
void getPerson(PERSON &p)
{
getPerson(test);
}
}
PERSON addresses[MAXADDRESS]:
const int MAX_ADDRESSES = 25;
int counter = 0;
int counter2 = 0;
PERSON addresses[MAX_ADDRESSES];
#endif
Comment