aboutsummaryrefslogtreecommitdiff
path: root/Project1/contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/contacts.cpp')
-rw-r--r--Project1/contacts.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp
index d7ce25c..e380479 100644
--- a/Project1/contacts.cpp
+++ b/Project1/contacts.cpp
@@ -35,7 +35,7 @@ contact_list::contact_list(const size_t& size)
//getters n setters
-void contact::Set_firstName(const char* firstName)
+void contact::Set_firstName(char* firstName)
{
_firstName = firstName;
}
@@ -44,7 +44,7 @@ const char* contact::Get_firstName()
return _firstName;
}
-void contact::Set_lastName(const char* lastName)
+void contact::Set_lastName(char* lastName)
{
_lastName = lastName;
}
@@ -53,7 +53,7 @@ const char* contact::Get_lastName()
return _lastName;
}
-void contact::Set_streetAddress(const char* streetAddress)
+void contact::Set_streetAddress(char* streetAddress)
{
_streetAddress = streetAddress;
}
@@ -62,7 +62,7 @@ const char* contact::Get_streetAddress()
return _streetAddress;
}
-void contact::Set_city(const char* city)
+void contact::Set_city(char* city)
{
_city = city;
}
@@ -71,7 +71,7 @@ const char* contact::Get_city()
return _city;
}
-void contact::Set_state(const char* state)
+void contact::Set_state(char* state)
{
_state = state;
}
@@ -89,7 +89,7 @@ int contact::Get_zip()
return _zip;
}
-void contact::Set_email(const char* email)
+void contact::Set_email(char* email)
{
_email = email;
}
@@ -191,9 +191,9 @@ void addContact(contact newContact, size_t MAX, contact_list contacts[])
}
}
-void contact_list::AddContact(const contact& newContact)
+void contact_list::AddContact(contact& Contact)
{
- contacts_[size_++] = newContact;
+ contacts_[size_++] = Contact;
//CURRENTLY TESTING
//for (size_t i = 0; i < size_, i++;)
//{
@@ -343,6 +343,22 @@ void contact_list::Print() const
//CURRENTLY WORKING
for (auto i = 0u; i < size_; ++i)
{
+
+ size_t check = 1;
+
+ if (contacts_[i].Get_id() == check)
+ {
+ i = i + 1;
+ }
+ if (contacts_[i].Get_id() == 0) {
+ break;
+ }
+ if (contacts_[i].Get_id() < 0) {
+ break;
+ }
+ if (contacts_[i].Get_id() > size_) {
+ break;
+ }
contacts_[i].print();
}
}