Cannot function C++ Linked List
This is my first post and I'm encountering a problem with a program I'm trying to create for a small game. What it involves is basically adding a Player onto a list using std::list.
Now, the issue with that is no matter what I do, only one of the values register so I need help to show you what is going wrong. Here is both General.h and General.cpp
First of all: General.h
That all seems satisfactory with me, that class. Moving onwards we come to General.cpp:
Okay so this seems decent to me and I've browsed many topics of linked-lists to come to this code. So my question to all of you is why is it only say that the list is a mere size of 1 when it should be right up to 11?
int i = 0;
while(i != 10)
entity = new Player;
entity->id = i;
entity->name = "Bobby";
std::cout << "There are " << (int) player_list.size() << " players in the linked-list" << endl;
No idea, hopefully someone can assist me as soon as possible! Thanks.