Question: C++ programming question class Address { public: Address(const std::string& street, const std::string& city, const std::string& state, const std::string& zip) : StreetNumber(street), CityName(city), StateName(state), ZipCode(zip) {}
C++ programming question class Address { public: Address(const std::string& street, const std::string& city, const std::string& state, const std::string& zip) : StreetNumber(street), CityName(city), StateName(state), ZipCode(zip) {} std::string GetStreetNumber() const { return StreetNumber; } void SetStreetNumber(const std::string& street) { StreetNumber = street; } std::string GetCity() const { return CityName; } void SetCity(const std::string& city) { CityName = city; } std::string GetState() const { return StateName; } void SetState(const std::string& state) { StateName = state; } std::string GetZipCode() const { return ZipCode; } void SetZipCode(const std::string& zip) { ZipCode = zip; } private: std::string StreetNumber; std::string CityName; std::string StateName; std::string ZipCode; };
If an array of Address objects, using the class definition above, were to be created using the line below, what would happen?
Address myAddresses[100];
| A. | The code would not compile. |
| B. | An array of 100 Address objects would be instantiated. |
C. The compiler would generate the necessary functions to create the objects.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
