|
-
September 26th, 2010, 09:48 PM
#17
Re: Call Array Member in function Help
Congratulations you got it working! It's still a little weird though, but I think that's not your fault, it's rather inherent in that assignment.
 Originally Posted by M2W
If you see an obvious error, please let me know [...].
Ok, you explicitly asked for it... 
You are still leaking memory. There's no single delete in the entire program.
BTW, now if I could find an easy way to access any of the nodes' data members would be golden.
Maybe your'e lucky you didn't try: They're all uninitializad! They do no harm in that condition as long as you don't access them, but it's bad style anyway. Aside from that: You would access them just like any other members, using the -> or . operator.
And I still think the ubiquotious (at least they were some years ago) factorial and Fibonacci sequences are still better examples of recursion. They don't use linked lists though...
Good luck in your further process of learning C++.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|