delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/22/20:58:26

From: calias DOT bbs AT cszone DOT twbbs DOT org (¦p¦¹³o¯ë)
Newsgroups: comp.os.msdos.djgpp
Subject: pointer & structure
Date: 23 Dec 1999 00:47:07 GMT
Organization: µ{¦¡³]­p¼Ö¶é(CSZone)
Lines: 30
Message-ID: <3Y97Ai$Pyn@cszone.twbbs.org>
NNTP-Posting-Host: octa2.ee.ntu.edu.tw
X-Trace: gemini.ntu.edu.tw 945910821 315 140.112.17.90 (23 Dec 1999 01:00:21 GMT)
X-Complaints-To: postmaster AT news DOT ntu DOT edu DOT tw
NNTP-Posting-Date: 23 Dec 1999 01:00:21 GMT
X-Filename: n.djgpp/M.945910028.A
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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;
//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?

--
¡° Origin: µ{¦¡³]­p¼Ö¶é ¡» From: sowhat.m1.ntu.edu.tw

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019