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?
#include<iostream>
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 << "How many Students record you want :\t ";
cin >>n;
Data Student[n];
}