title: In C++, what is the recommended way to create 'n' number of objects, where n is user defined. How can I do this?
body: <p>I want the number of objects that my program creates, to be controlled by the user. What are the different ways to do this and when should I choose one approach over another?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  class
  {
  public :
     int FullName;
     int RollNumber;
     in
  {
  public :
     int FullName;
     int RollNumber;
     int age;
     int marks;
  }
  voidt age;
     int marks;
  };
  void main()
  {
     int n;
     cout &lt;&lt; "How many Students record you want :\t ";
     cin &gt;&gt;n;     
     Data Student[n];
  }
  </code></pre>