Article View: comp.lang.oberon
Article #857Re: NEW(p)
From: skulski
Date: Sun, 28 Jan 1996 01:46
Date: Sun, 28 Jan 1996 01:46
24 lines
1154 bytes
1154 bytes
In article <4ecf43$93h@wariat.wariat.org>, enikitin@junior.wariat.org (Eric W. Nikitin) writes: > Bronxx (rmichl@iiic.ethz.ch) wrote: > : NEW(p) > : ~~~~~~ > : That means we have to create each pointer with NEW(p) before we can > : work with it. > : For example > > : TYPE P = POINTER TO PDesc; > : PDesc = RECORD key: Key; next: P END; > > : VAR p:P; > > : What about the p.next then? It is a pointer too, does it have to > : be created with NEW() as well? I guess not. What is it's value? NIL? > > Yes, its value is NIL. Not necessarily. It depends on the compiler switches. It is always safer to explicitly initialize it to NIL, even though it may take some CPU cycles. Wojtek
Technical Details
Message-ID:
<1996Jan27.204647.1@fermi.nsrl.rochester.edu>Path:
arc1-ca.pugleaf.net!fermi.nsrl.rochester.edu!skulskiReferences:
<4eak7d$nm5@neptune.ethz.ch> <4ecf43$93h@wariat.wariat.org>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.oberon Path: arc1-ca.pugleaf.net!fermi.nsrl.rochester.edu!skulski From: skulski@fermi.nsrl.rochester.edu Subject: Re: NEW(p) Message-ID: <1996Jan27.204647.1@fermi.nsrl.rochester.edu> Sender: news@galileo.cc.rochester.edu Nntp-Posting-Host: nsrlc6.nsrl.rochester.edu Organization: Nuclear Structure Research Laboratory References: <4eak7d$nm5@neptune.ethz.ch> <4ecf43$93h@wariat.wariat.org> Date: 27 Jan 96 20:46:47 -0500