title: c++ 2 constructors and a destructor in a class
body: <p>This is correct code from a classmate the professor bragged about and I cant understand why it requires a double constructor i originally only had the first function and couldnt figure out it required two which lagged my progress as a professional</p>
  
  <pre><code>class Studentrecords
  {
  private:
  
      struct student
      {
          string name;
          string address;
          int ID;
          double gpa;
      };
  
      student *stackArray;
      int stackSize;
      int top;
  
  public:
      Studentrecords();
      Studentrecords(int size);
      ~Studentrecords();
      void push(string name, string address, int id, double gpa);
      void pop();
      bool isFull() const;
      bool isEmpty() const;
      void display();
  };
  
  Studentrecords::Studentrecords(int size)
  {
      stackArray = new student[size];
      top = 0;
  }
  
  Studentrecords::Studentrecords()
  {
      stackSize = 25;
      stackArray = new student[stackSize];
      top = 0;
  }
  
  Studentrecords::~Studentrecords()
  {
      delete [] stackArray;
  }
  </code></pre>