View Single Post
Old Oct 28th, 2005, 8:59 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
One would need to see the entire error message to know precisely what the problem is. Very, very often, it's a mismatch in the level of indirection, or a misperception between the difference between an array name and a pointer. Sometimes it's as simple as the difference between a char and an array of char. Look at your function definition:
cityNode* createNode(double x, double y, char tempCity)
{
   ...
   blah blah blah
   ...
}
This says that "tempCity" is A SINGLE CHARACTER, from the viewpoint of what the function expects to find in its argument list. That would (in English) restrict you to a maximum of 26 distinct cities. I doubt that's what you truly intend. I suspect you meant to reference an array of char.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote