aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-18 16:16:01 -0800
committerConnor McDowell <[email protected]>2024-02-18 16:16:01 -0800
commit1bacd198368da82c8d1041ada746a2bf7df52898 (patch)
tree9d33505921941171c8fc4f1f3eb942e728ee0de6
parentgot moving through the list working, but now print is broken; (diff)
downloadhomework-5-connormcdowell275-1bacd198368da82c8d1041ada746a2bf7df52898.tar.xz
homework-5-connormcdowell275-1bacd198368da82c8d1041ada746a2bf7df52898.zip
print fixed
-rw-r--r--Project1/contacts.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp
index 99db58d..f4a89aa 100644
--- a/Project1/contacts.cpp
+++ b/Project1/contacts.cpp
@@ -88,13 +88,16 @@ void printAll(contact newContact[], size_t MAX)
/*for (int t = -1; t < newContact[i].id;) {
break;
}*/
+ if (newContact[i].id == 0) {
+ break;
+ }
if (newContact[i].id < 0) {
- if (newContact[i].id >= MAX){
- if (newContact[i].id == 0) {
- break;
- }
- }
+ break;
}
+ if (newContact[i].id > MAX) {
+ break;
+ }
+
cout << "List number: " << newContact[i].id << endl;
cout << "name: " << newContact[i].Name << endl;
cout << "Email: " << newContact[i].Email << endl;
@@ -102,6 +105,5 @@ void printAll(contact newContact[], size_t MAX)
cout << "city: " << newContact[i].City << endl;
cout << "state: " << newContact[i].State << endl;
cout << "Zip: " << newContact[i].Zip << endl;
-
}
}