Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!mahendo!wlbr!voder!pyramid!altos!gumby!jerry From: jerry@gumby.Altos.COM (Jerry Gardner) Newsgroups: comp.lang.pascal Subject: Re: need dynamic array on heap Message-ID: <4816@gumby.Altos.COM> Date: 16 Apr 91 17:17:23 GMT References: <1991Apr12.234843.9031@ux1.cso.uiuc.edu> Reply-To: jerry@altos.COM (Jerry Gardner) Organization: Altos Computer Systems, San Jose, CA Lines: 35 In article <1991Apr12.234843.9031@ux1.cso.uiuc.edu> amead@s.psych.uiuc.edu (alan mead) writes: >I want to put aside a chunk of the heap and then index it by byte like >an array of byte. I could just declare it as some type like >'array[1..64000] of byte', but I want to use GetMem so that the array will >really be dynamic (I don't want to use 64K each time). > > Buff[1]^ := 2; > ^ Invalid qualifier > >so does anyone know, is this sort of thing possible? Can you do this >easily in C? This is very easy in C: main() { char *buff; buff = (char *)malloc(1000); buff[0] = 2; } -- Jerry Gardner, NJ6A Altos Computer Systems UUCP: {sun|pyramid|sco|amdahl|uunet}!altos!jerry 2641 Orchard Parkway Internet: jerry@altos.com San Jose, CA 95134 Help stamp out vi in our lifetime. (408) 432-6200