I want to make a library management system as an assignment
class student
{
char ID_number[30];
char Student_name[30];
public:
void create_student()
{
cout<<"\nEnter The ID Number ";
cin>>ID_number;
cout<<"\n\nEnter The Name of The Student: ";
cin>>Student_name;
cout<<"\n\nStudent Created Successfully"<<endl;
}
void show_student()
{
cout<<"\nID Number: "<<ID_number;
cout<<"\nStudent Name: ";
cin.getline(Student_name,30);
}
How would i go about using dynamic allocation to make every new entry go into an array and use pointers to show a certain student?
I am really bad at this particular part, thanks in advance!
std::vector<student>.vectorprovide dynamic allocation. You don't need to specify the size of itvector.