First page Back Continue Last page Graphics
Classes & Dynamic Memory
Special considerations for new, delete, and static.
Example: StringBad (to remind you it's under construction)
- class StringBad {
- public:
- StringBad(const char * s); // constructor
- ~StringBad( );
- ...
- private:
- char * str; // pointer to string
- int len; // length of string
- static int num_strings; // number of objects
- };