Ok.very weird problem. Thanks to whoever can helpme here.
I have these double linked lists defined properly and working fine. I call them "pNode", and "pNode3".
The data inside pNode contains strings of words that I gathered from a text file.
Now, I need to start from the head of the pNode (I called it pHead) and go until end of the line 1 AND add all the data from pNode to pNode3 (I do the add with adddll3 function....
Now the problem starts.... on second itteration, I need to add the data from line 2 of pNode to pNode3... such that pNode3 now contains only the data of line 2 of pNode.......
It is done until there is no more data .......
What the following does is .. it takes in line 1 on 1st iteration, then line 1 &2 on second iteration, then line 1,2,3 on 3rd iteration.... and so forth. I need to take in line 1 for 1st, then on second line 2 such that the contents of the Pnode3 is overwritten with this content.......
please help me
the display function just displays everything inside the the pNode3....Code:pNode=pHead; pNode3=PHead3; for(pNode;pNode!=EOF ; pNode=pNode->pNext) { for(pNode;strcomp(pNode->nData,newlinetest)!=0;pNode=pNode->pNext) { adddll3(pNode->nData); } printf("\n******** \n"); display3(pNode3); printf("\n"); }