Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (mandre):

Trying to set up a linked list using classes but failing dismally. I copied the code exactly from the textbook but it does not tell you how to set up the classes.

OpenStudy (mandre):

I get a large number of errors including: 'nodeType' does not name a type. 'current' was not declared in this scope. 'NULL' was not declared in this scope. I think my problem is that the classes must somehow refer to each other but not sure how to go about that. Too much code to post here. Class files: linkedListIterator.cpp and h linkedListType.cpp and h orderedLinkedList.cpp and h

OpenStudy (turingtest):

"'nodeType' does not name a type" suggests that they were expecting something like typedef nodeType <blah blah> As far as the scoping problems I really wouldn't know where to start without being able to see the code, but just remember that classes can share methods and attributes through subtyping and inheritance, so you may want to look into that to resolve those issues.

OpenStudy (mandre):

There were some minor problems I picked up, but the big one was this (pun not intended): When using inheritance in Codeblocks the child must use "this->" in front of all items inherited from the parent, like "first" becomes "this->first" and "last" becomes "this->last". This is not needed in Visual C++.

OpenStudy (turingtest):

Good to know!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!