Computer Science 1037A/B Lecture Notes - Lecture 37: Headache

31 views4 pages

Document Summary

To avoid confusion, we will rename char-based class to dynarraychar. To store other types of values one must define different classes like dynarrayint or. Code for class dynarrayfloat would be almost identical to the code for class dynarraychar, except for a few minor modifications: Name dynarraychar must be replaced by a different class name (dynarrayfloat) throughout. Return value for operator[ ] is of type float& m_container points to an array of float constructors must reflect this change when dynamically allocating arrays to hold data. Let"s try to generalize the approach used with char data to build dynarray of any class of. Let"s try to generalize the approach used with char data to build dynarray of any class of objects . We will also implement a couple of improvements. If we need dynarrays for 2 different kinds of objects in the same program, we will need to code 2 nearly identical classes.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents