home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!csd.unb.ca!mta.ca!TCSMITH
- From: tcsmith@mta.ca (Tim Smith)
- Subject: Pointer problems...
- Message-ID: <1992Nov21.181025.18275@jupiter.sun.csd.unb.ca>
- Sender: news@jupiter.sun.csd.unb.ca
- Reply-To: tcsmith@mta.ca
- Organization: Mount Allison U, Sackville, N.B. Canada
- Date: Sat, 21 Nov 1992 18:10:25 GMT
- Lines: 27
-
- I wonder if someone could please explain why these pointer operations don't work...
- {*****problem 1**********************}
- var
- p1: ^byte;
- p2: ^byte;
- p3 : pointer;
- begin
- getmem(p3,100);
- p1:=P3;
- p2:=addr(p1);
-
- writeln(p1^,' ',p2^,' ');
- ^^^-----^^^ Why won't these two values be equal?
- freemem(p3,100);
- end.
-
- {*****problem 2**********************}
- var
- P1 : ^Byte;
- P2 : ^Byte;
- begin
- new(p1);
- p2:=p1; { Why is this illegal }
-
- dispose(p1);
- end.
-
-