title: How to print Student's grades (class Student) in C++
body: <p>I have a class Student with</p>
  
  <p><strong>string surname; 
  unsigned int number_of_gradebook; 
  static int size; 
  unsigned int *p = new unsigned int[size];</strong></p>
  
  <p>But an array of grades seems not to be outputed.</p>
  
  <p>My code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  #include &lt;string&gt;
  using namespace std;
  
  class Student {
  private:
      string surname;
      unsigned int number_of_gradebook;
      static int size;
      unsigned int *p = new unsigned int[size];
  public:
      Student(string s, unsigned int n, static int size, unsigned int *q):surname(s) {
          number_of_gradebook = n;
          //unsigned int *p = new unsigned int[size];
          for (int i = 0; i++; i &lt; size) {
              p[i]=q[i];
          }
      }
      Student() {}
      ~Student() { delete[]p; }
  
      //friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, const Student);
      string GetSurname() const { return surname; }
      unsigned int GetNumOfGrdb() const { return number_of_gradebook;  }
      unsigned int GetMarks() const { return *p; }
      void Print_Student();
  
  };
  
  int Student::size=0;
  
  void Student :: Print_Student() {
      cout &lt;&lt; "Student: " &lt;&lt; surname &lt;&lt; "\t" &lt;&lt; number_of_gradebook &lt;&lt; endl;
      if (size) {
          for (int i = 0; i++; i &lt; size) {
              cout &lt;&lt; p[i] &lt;&lt; "\t";
          }
      }
  }
  
  class Group {
      Student *s;
      int count;
  public:
      Group(int n=0) {
          s = new Student[count = n];
      }
      ~Group() { delete[]s; }
      friend void AddStudent();
      friend void DeleteStudent();
      friend void FindAveragePoint();
      friend void PrintFiveBest();
      void output() {
          cout &lt;&lt; s &lt;&lt; endl;
      }
  };
  
  int main() {
      Student A("Ivanov", 45368400, 5, new unsigned int[5] {3,4,4,5,3});
      A.Print_Student();
      cout &lt;&lt; A.GetMarks();
      system("pause");
  }
  </code></pre>
  
  <p>Any suggestions?</p>