read xeraths comment. it says it all. You use a list thats not there. fFirts is NULL on first use so temp is also NULL. This is your problem.
read xeraths comment. it says it all. You use a list thats not there. fFirts is NULL on first use so temp is also NULL. This is your problem.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
yes Stoned_CoderOriginally Posted by Stoned_Coder
i think that's it
there is no LinkedList object , so i have to creat it it first , but the my problem now that in the Main function i call Calculator Object ,, but i don't get it to start the program using LinkedList Object
thanks
If this is in fact empty, which by definition means that 'fFirst' is null, then how can you be calling 'fFirst->setNext(data)'? You're trying to access a null pointer there. That's bad.Code:if (isEmpty()) { fFirst->setNext(data); }
Quzah.
Hope is the first step on the road to disappointment.
hi quzahOriginally Posted by quzah
but it's the same when you creat a new object you set the pointers to NULL then you let them point to what ever
You're missing the point. If a pointer 'fFirst' is in fact null, then you cannot dereference it to access one of its members. Thus, 'fFirst' has no 'setNext()' function, because you have no instance of 'fFirst'. Create an instance, make 'fFirst' point to it, and then you can access 'fFirst->whatever'. But until you have an instance that you're actually pointing to, you cannot use its members (unless they're static, but that's another issue entirely).
Quzah.
Hope is the first step on the road to disappointment.