diff options
| author | Connor McDowell <[email protected]> | 2024-02-22 18:03:42 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-22 18:03:42 -0800 |
| commit | 10eab35f2834eb06df36b82ddcd0a06c5d3a104c (patch) | |
| tree | 543322117c57ccb3f37b5125d02ae2b8fb448c71 /Project1/contact.cpp | |
| parent | print created (diff) | |
| download | in-class-exercise-13-connormcdowell275-10eab35f2834eb06df36b82ddcd0a06c5d3a104c.tar.xz in-class-exercise-13-connormcdowell275-10eab35f2834eb06df36b82ddcd0a06c5d3a104c.zip | |
i love following the lecture exactly and getting undefined behavior.
Diffstat (limited to 'Project1/contact.cpp')
| -rw-r--r-- | Project1/contact.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Project1/contact.cpp b/Project1/contact.cpp index b195609..cfbbb47 100644 --- a/Project1/contact.cpp +++ b/Project1/contact.cpp @@ -7,9 +7,9 @@ using std::endl; -void contact::Set_firstName(char firstName) +void contact::Set_firstName(const char* firstName) { - *_firstName = firstName; + *_firstName = *firstName; } char* contact::Get_firstName() @@ -17,9 +17,9 @@ char* contact::Get_firstName() return _firstName; } -void contact::Set_lastName(char lastName) +void contact::Set_lastName(const char* lastName) { - *_lastName = lastName; + *_lastName = *lastName; } char* contact::Get_lastName() @@ -27,9 +27,9 @@ char* contact::Get_lastName() return _lastName; } -void contact::Set_streetAddress(char streetAddress) +void contact::Set_streetAddress(const char* streetAddress) { - *_streetAddress = streetAddress; + *_streetAddress = *streetAddress; } char* contact::Get_streetAddress() @@ -37,9 +37,9 @@ char* contact::Get_streetAddress() return _streetAddress; } -void contact::Set_city(char city) +void contact::Set_city(const char* city) { - *_city = city; + *_city = *city; } char* contact::Get_city() @@ -47,7 +47,18 @@ char* contact::Get_city() return _city; } -int contact::Set_zip(int zip) +void contact::Set_state(const char* state) +{ + *_state = *state; +} + +char* contact::Get_state() +{ + return _state; +} + + +void contact::Set_zip(int zip) { _zip = zip; } @@ -57,9 +68,9 @@ int contact::Get_zip() return _zip; } -void contact::Set_email(char email) +void contact::Set_email(const char* email) { - *_email = email; + *_email = *email; } char* contact::Get_email() |