Hey all.
Um having a bit of problem trying to make an object with all its member data placed into a linked list so i can access it all using Nodes.
i have the following code:
//kill, username, email, kill count
soldier Bob(1,"Twinsen","Twhj@jher.com",2345);
constructor:
soldier( int rank, std::string NickName, std::string EmailAddress, int totalKills );
okay i have created the object bob and passed some values onto it, using the default construcor.
I have my linked list working aswell, and thats all kool.
But when i try and add Bob to the linked list it says that its redifining it.
List Players;
Players.insert(Players.begin(),Bob);
okay this is where i have the problem, when i put the above line in it says:
error C2664: 'List::insert' : cannot convert parameter 2 from 'soldier' to 'std::string'
now i dont think i'm declaring the node right, and i dont know if that by placing just the object gavan in the list will also include all of the objects data.
Also please note that the link list is working fine, but i'm still learning and have only stored strings in the list, so its all working fine.
Nehelp would be much appreciated :)