title: how to do setter and getter functions for a pointer class variable?
body: <p>let say i have a student class with a program class pointer for programEnrolled? how to i do the getter and setter and how do i access the member inside the programEnrolled (programName, programFees) through programEnrolled?</p>
  
  <p>and when should i use a pointer function?</p>
  
  <pre><code>class clsStudent
  {
  private:
      string studentName;
      string studentID;
      clsProgram *programEnrolled;
  };
  
  class clsProgram{
  private:
      string programName;
      double programFees;
      string programCode;
  };
  </code></pre>