Hi There..<p>
I am having a little problem here, Ill describe it<br>
with a bit of code, maybe you will figure out what I do wrong<br>
I mean I know what I do wrong, I just dont know how to do it<br>
the 'right way'.. here I go<p>
typedef struct _point {<br>
int x;<br>
int y;<br>
int z;<br>
struct _point *next;<br>
} point;<p>
ok, the problem is when I want to attach a point<br>
to another point.. what I do is,..<p>
void attach ( point *dest, point *src )<br>
{<br>
while (dest)<br>
dest = dest->next;<p>
dest = src;<br>
}<p>
it works well when dest == NULL;<br>
but when dest is already pointing to a point<br>
it will over write the existing point because the pointing <br>
address of dest will be over written by the next point<br>
anytime I do dest = dest->next;<p>
I could always do<p>
if (!dest->next)<br>
dest->next = src;<br>
else if (!dest->nest->nest)<br>
dest->next->next = src;<p>
but you know that is not good to do, I mean it I have 100<br>
points to attach, can you imagine the amount of<br>
->next->next->next->next I would have to do ?<p>
Please if somebody can tell how<br>
how I can go attach a point to a last ->next which is<br>
NULL without over writting my preview point ?<br>
You dont know how thankful I would be :)<br>
thanks :)