From: alainm AT news DOT RISQ DOT QC DOT CA (Alain Magloire) Subject: Re: pointer & structure Newsgroups: comp.os.msdos.djgpp References: <3Y97Ai$Pyn AT cszone DOT twbbs DOT org> X-Newsreader: TIN [version 1.2 PL2] Lines: 40 Message-ID: Date: Thu, 23 Dec 1999 01:34:11 GMT NNTP-Posting-Host: 132.206.63.174 X-Complaints-To: abuse AT mcgill DOT ca X-Trace: carnaval.risq.qc.ca 945912851 132.206.63.174 (Wed, 22 Dec 1999 20:34:11 EST) NNTP-Posting-Date: Wed, 22 Dec 1999 20:34:11 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com ¦p¦ąłoŻ (calias DOT bbs AT cszone DOT twbbs DOT org) wrote: : hmm. I didn't have much experience about pointer&structure.. : but it is quite strange... : the structure : : struct LINEPtr{ : CONNECTLINE *clptr; : LINEPtr *next; : }; : //(it is in a member function of class) : LINEPtr *clp,FirstPtr; : FirstPtr=clp; Without looking to much further, You are assignement does not look right unless, you meant LINEPtr *clp, *FirstPtr; ^^^ : //when i use : clp->next=new LINEPtr; : clp=clp->next; : clp->clptr=(something) : clp->next=FirstPtr->next; : //then i delete : clp=clp->next; : delete clp; : //the value of clp->next become 0x3 : //and I can't use it to delete the next one... : //but this kind pointer&structure : //i can use it exactly in other place : //why? -- au revoir, alain ---- Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!