From 01dc1dbc161fadbe169908c0200d3d2a39490a72 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Sat, 9 Mar 2024 17:40:06 -0800 Subject: running tests to fix read access violation --- My structures/Contact.hpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'My structures/Contact.hpp') diff --git a/My structures/Contact.hpp b/My structures/Contact.hpp index 15c8317..7a230d7 100644 --- a/My structures/Contact.hpp +++ b/My structures/Contact.hpp @@ -2,6 +2,10 @@ #define CONTACT_HPP #include + +using std::cin; +using std::cout; +using std::endl; using namespace std; namespace myStructures @@ -12,6 +16,7 @@ namespace myStructures public: // constructors and destructors. contact() = default; + contact(size_t a, string firstName, string lastName, string streetAddress, string city, string state, int zip, string email); ~contact() = default; @@ -57,7 +62,7 @@ namespace myStructures private: size_t _a = 0; // _a functions as delete bool. if a = 1, the slot is overwritten - int _id; + /*int _id;*/ string _firstName; string _lastName; string _streetAddress; @@ -71,6 +76,13 @@ namespace myStructures // constructor defs for CLASS CONTACT + template + contact::contact(size_t a, string firstName, string lastName, string streetAddress, string city, string state, + int zip, string email) + { + + } + template contact::contact(const contact& copy) { @@ -204,27 +216,16 @@ namespace myStructures _a = a; } - template - size_t contact::Get_id() - { - return _id; - } - template - void contact::Set_id(size_t id) - { - _id = id; - } - template void contact::print() { - cout << "Contact number: " << _id << endl; + //cout << "Contact number: " << _id << endl; cout << "Full name: " << _firstName << " " << _lastName << endl; + cout << "Email: " << _email << endl; cout << "Street Address: " << _streetAddress << endl; cout << "City: " << _city << endl; cout << "State: " << _state << endl; cout << "Zip code: " << _zip << endl; - cout << "Email: " << _email << endl; } } -- cgit v1.2.3