Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [GDK] std::list library - adding derived classes to a linked list example

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 4th Jan 2011 19:35
After playing around with linked lists I wanted to suss out how to add derived classes into a linked list. I found it was much easier to create the object class using "new" and push the pointer to the object onto the list.

Here's a working example of a 2d editor which I'm going to be working on.

"Main.cpp"


"drawings.h"


I hope this helps understanding derived classes and adding them to a list.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-04-20 03:08:32
Your offset time is: 2024-04-20 03:08:32