diff options
| author | Connor McDowell <[email protected]> | 2024-02-26 16:27:12 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-26 16:27:12 -0800 |
| commit | c3b095676f0736a1712d8da1013a85bb3e467e58 (patch) | |
| tree | 66deb37530fec574fd10d2975e909a150302c566 /Project1/Contacts.h | |
| parent | added menu driven address book from assignment 6 (diff) | |
| download | homework-7-connormcdowell275-c3b095676f0736a1712d8da1013a85bb3e467e58.tar.xz homework-7-connormcdowell275-c3b095676f0736a1712d8da1013a85bb3e467e58.zip | |
getters and setters created
Diffstat (limited to 'Project1/Contacts.h')
| -rw-r--r-- | Project1/Contacts.h | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/Project1/Contacts.h b/Project1/Contacts.h index 4ce76c4..31e497b 100644 --- a/Project1/Contacts.h +++ b/Project1/Contacts.h @@ -5,7 +5,81 @@ // functions -struct contact +class contact +{ +public: + contact() = default; + + contact(const contact& copy); + contact& operator=(const contact& rhs); + + contact(contact&& move); + contact& operator=(contact&& rhs); + + const char* Get_firstName(); + void Set_firstName(const char* firstName); + + const char* Get_lastName(); + void Set_lastName(const char* lastName); + + const char* Get_streetAddress(); + void Set_streetAddress(const char* streetAddress); + + const char* Get_city(); + void Set_city(const char* city); + + const char* Get_state(); + void Set_state(const char* state); + + int Get_zip(); + void Set_zip(int zip); + + const char* Get_email(); + void Set_email(const char* email); + + void print(); + +private: + const char* _firstName{ }; + const char* _lastName{ }; + const char* _streetAddress{ }; + const char* _city{ }; + const char* _state{ }; + int _zip; + const char* _email{ }; + +}; + +class contact_list +{ +private: + + contact* contacts_{ nullptr }; + + size_t length_{ 0 }; + + size_t size_{ 0 }; + +public: + + void set_length(size_t MAX); + size_t get_length(); + + void set_size(size_t size); + size_t get_size(); + + void DeleteContact(contact& contact); + + void CopyList(const contact* contacts, const size_t& size); + + void AddContact(const contact& contact); + + void Print() const; + + size_t Size() const; +}; + +struct contact_struct { int a = 0; size_t id = 0; |