-
Linked list trouble...
Hi all,
I'm reading lines of data from a file & storing them into variables (successfully) however when I try to create an object instance with the data & add it to a linked list I get an error.
Code:
// Insert a new member to MapClass list
mapLocationClass* tempLocation = new mapLocationClass( tempLocationID, tempLocationName, tempLocationDescription );
insertAtFront( tempLocation );
The error is:
Invalid conversion from 'mapLocationClass*' to 'int'
initializing argument 1 of 'mapLocationClass::mapLocationClass(int)'
I'm aware that this seems to be a problem with my mapLocationClass constructor, however I don't have a constructor which sets only the integer locationID. The constructor I have sets the integer & the two strings at the same time. o_O
Where should I look to find the solution?
-
Your not actually sending a mapLocationClass object, your sending a pointer to it. Maybe try dereferencing the pointer. Unless your error is occuring on construction, then its in your class and you should post it as well.
-
That worked a treat! Thanks so much!!! :^)
-
Is there a need for new at all, though?