i'v tryed to creat new node if fFirst is empty but got a problem to test if fFirst is empty
Code:void LinkedList::push_back (CalcCommand* data)
{
if (isEmpty())
{
fFirst->setNext(data);
}
else
{
CalcCommand* temp =fFirst;
while (temp->getNext() != 0)
{
temp = temp -> getNext ();//to let temp point to the last node in the list
}
temp -> setNext (data);//this will add data to the end of the list
data -> setNext (0); //and this will set the one after the end of the list to NULL
}
}