diff options
| author | Connor McDowell <[email protected]> | 2024-03-07 11:51:13 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-03-07 11:51:13 -0800 |
| commit | f4cd2b74707a489fdaf40afd0173c82701b32bcd (patch) | |
| tree | fb8cc62fdbe3fcca4b87f15c29ceecb5d0ea143a /Project1 | |
| parent | print still not working but list creation fixed. (diff) | |
| download | homework-7-connormcdowell275-f4cd2b74707a489fdaf40afd0173c82701b32bcd.tar.xz homework-7-connormcdowell275-f4cd2b74707a489fdaf40afd0173c82701b32bcd.zip | |
starting work
Diffstat (limited to 'Project1')
| -rw-r--r-- | Project1/contacts.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp index a7def13..2fec269 100644 --- a/Project1/contacts.cpp +++ b/Project1/contacts.cpp @@ -17,13 +17,13 @@ contact_list::~contact_list() contact* contact_list::allocateContactList(const size_t& size) { - contact* contacts = nullptr; + contact* contacts_ = nullptr; length_ = size; - contacts = new contact[size]; + contacts_ = new contact[size]; - return contacts; + return contacts_; } contact_list::contact_list(const size_t& size) @@ -240,7 +240,8 @@ void contact_list::AddContact(contact& Contact, size_t& t) cout << "enter Zip: " << endl; cin >> Zip; contacts_[i].Set_zip(Zip); - contacts_[size_++] = Contact; + contacts_[size_++] = Contact; + break; } } |