C++ Consider the following class code segment: class dynamicClass { public: ……. private: string name; int *q; int length; }; // constructor dynamicClass:: dynamicClass () { q = new int[10]; // dynamic...


C++



  1. Consider the following class code segment:


class dynamicClass {


  public:   …….


  private:


    string name;


    int *q;


    int length;


};



         // constructor


           dynamicClass:: dynamicClass () {


              q = new int[10];   // dynamic data


                     ….


           }


-Name at least
TWO
class functions you should add/code for the dynamic data in this class.  (HINT:  Look at the member variables).  Just name the modules,
you do not have to write code.



- Adding this code prevents what type(s) of issues that can occur with pointer/dynamic data.



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here