I have a project to do that uses Link lists and I'm somewhat confused. I think I'm up to the point where I need to call on things in my main so that I can add/delete/count ect. to the list but I am unsure of how to do so and my book is being of no help.
For an example in my main the line:
cout << "There are currently " << << " Students registered" << endl;
I need the count list function to output how many students are in the list
1. Create a new class called "university" which contains a linked list of nodes. Each of these nodes contains a "Student".
or
2. Add a linked list to your "Students" class. Each time you add a new student, add a node containing a student into the linked list.
Then you can traverse the linked list to get the size. Or, better yet, add code to your insert function that updates a size counter data member each time a new student is added and reduce the size counter each time a student leaves.