i have problem where the address is not save to my file after iinput a new address and exit it
#include<string>
#include<iostream>
#include<fstream>
#include<sstream>
using namespace std;
typedef struct date {
int day;
int month;
int year;
}Date;
typedef struct add {
string building;
string street;
string city;
string state;
string zip;
}Address;
typedef struct entry {
string firstName;
string lastName;
Address address;
string phNo;
Date birthDate;
struct entry* next;
}AddressEntry;
class AddressBook {
public:
AddressBook();
AddressEntry * getFirst();
void addEntry(AddressEntry *entry);
void print(AddressEntry *entry);
void search(int);
bool deleteentry(int);
void writeToFile();
private:
AddressEntry * firstEntry;
};
AddressBook::AddressBook() {
firstEntry = nullptr;
}
int newEntry(AddressBook *book);
int loadData(AddressBook *book);
int main() {
AddressBook *aBook = new AddressBook;
int noOfEnties = loadData(aBook);