class Person {
string name; int age; public: Person(string n, int a) : name(n), age(a) {} string get_name() const { return name; } int get_age() const { return age; } }; |
What special methods (constructors, destructors, assignment operators) will the compiler automatically generate for this class? Write explicit versions of these special methods that are equivalent to the ones the compiler would generate. Are these what you would want?
Change the representation of strings so that the allocated character array can be longer than the string it currently holds. You will need to
s1 = String("wheel");
|
Add output statements to appropriate places to verify your theory.