I used to program in C and I moved to C++ after learning OOP. I am trying to use the things I learned in my new project.
I am working on a school management project. If I want to add 1 student, I can use the constructor:
Student student1 = Student(string firstname, string lastname, int Age, char Gender, int group);
That would work fine in adding 1 student, but if I want to add more then 1 student using a loop, how can I do it?
In C, we use a struct to do this:
struct student{...};
struct student students[n] //n: number of student i want to add
for(int i=0;i<n;i++){
students[i].name = ...;
}
Is there a way to achieve this in OOP (I am new in using OOP)?