Archived

This topic is now archived and is closed to further replies.

EbonySeraph

Linked List of Classes?

Recommended Posts

Is it possible? Can you create a class with a pointer to the next one? Or is it not possible/bad form? Just wondering. I have never seen a linked list of classes or heard of someone making one. "Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.

Share this post


Link to post
Share on other sites
well, its the same as a normal linked list of structs... whats the difference using classes ???

you could overide the operators.. that would look cool ..



{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites
Well you could also add member functions to add a new item to the list, sort the list, print the list, or anything you would normally do to a list and have it all in a nice little class package. I would suggest having two classes. One for the node and the other with the member functions and such to do stuff to this list. This way it reduces some of the overhead of each node. Well so i have been told.

-SirKnight

Share this post


Link to post
Share on other sites
Not sure about conserving overhead like that, but it''s probably good.

There are standard classes that do this stuff, too. Might want to peek in their implementations.

Share this post


Link to post
Share on other sites