Hello, my assignment is to create a linked list of pointers to objects (in this case the 'video' class). I understand how to use linked lists for integers, but I'm kind of lost getting started with using objects.
What I want to be able to do is call vlist.insert( new Video(...,...,...,...,...));
But I really don't know the syntax for doing it, and I'm not super comfortable with pointers and dereferencing and all that stuff.
If I can figure out how to get a working Node with the pointer in it, I can do the rest of the program no problem, but for now I'm stuck here. Thanks for any help you can give!
If you haven't figured this out yet, I hope you see this before the assignment is due!
Try creating the new videos inside your insert function, passing the arguments for your video object to the insert function. Do not pass the pointer to your video object to the insert function, instead make the pointer to the video a member variable of your Node class:
Video *m_video;
When you are trying to access your video in main() for say, a print function, then you can do this, assuming your video object has a member function for printing: