Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!uw-beaver!zephyr.ens.tek.com!tektronix!reed!reeder From: reeder@reed.bitnet (Doug Reeder,,,2343817) Newsgroups: comp.sys.apple2 Subject: Re: ORCA/Pascal dynamic arrays Keywords: dynamic Message-ID: <15175@reed.UUCP> Date: 12 Jul 90 03:57:21 GMT References: <368@ankh.ftl.fl.us> Sender: news@reed.UUCP Reply-To: reeder@reed.bitnet (Doug Reeder) Organization: Reed College, Portland, OR Lines: 17 In article <368@ankh.ftl.fl.us> chin@ankh.ftl.fl.us (Albert Chin) writes: >Is it possible to do the following in Pascal, like in C: >char *pointer; >.. >pointer=malloc(4000*sizeof(char)); /* dynamically allocate pointer[4000] */ Pascal considers pointer arithmetic to be a source of program anarchy, so it is not allowed. There are no Pascal statements that correspond to EXACTLY to the above C code. If you want a data structure of fixed size, an array will do nicely. If the data structure size is determined after compile-time, you must build a linked list, unless you're using an ISO level 1 compliant compiler with conformant arrays. Doug Reeder USENET: ...!tektronix!reed!reeder from ARPA: tektronix!reed!reeder@berkeley.EDU BITNET: reeder@reed.BITNET 7th: Each swallow works hard to be perfect pilot-provider-builder-trainer- teacher-lover-mate,no half-true hate! - Dr.Brommer's 18-in-1 Pure Castile Soap