Skip to main content
Removed c++ from the title, as there's a tag for it.
Link
Mr.C64
  • 43.3k
  • 15
  • 97
  • 170

c++ Using dynamic allocation to create an array and insert elements into it

Source Link

c++ Using dynamic allocation to create an array and insert elements into it

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!