I have a linked list and a method that inserts certain elements in the link. When going trough the list in the method I make the changes the list is changed as i want, but when i use the list in another function the list is not updated, it contains null components. What can I do in order for my list to remain changed?
this is the functin that modifies the list
Expand|Select|Wrap|Line Numbers
- BYTE CheckComponents()
- {
- Node *comp=components, *x, *y;
- while (comp!=NULL)
- {
- ..............................
- y = new Node("Telegram", telegram, PLAIN_DESC);
- y->setNext(comp->getNext());
- comp->setNext(y);
- comp=comp->getNext();
- }
- }
thanks