Newsgroups: comp.lang.pascal Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!s.psych.uiuc.edu!amead From: amead@s.psych.uiuc.edu (alan mead) Subject: need dynamic array on heap Message-ID: <1991Apr12.234843.9031@ux1.cso.uiuc.edu> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Date: Fri, 12 Apr 1991 23:48:43 GMT Lines: 28 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). So, I'm trying this: program Test; type C_arrayType = array[1..1] of byte; var Buff : ^C_arrayType; begin GetMem( Buff,1000 ); Buff[1]^ := 2; end. But I get Buff[1]^ := 2; ^ Invalid qualifier so does anyone know, is this sort of thing possible? Can you do this easily in C? Thanks, -alan mead : amead@s.psych.uiuc.edu