home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 8048 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.2 KB  |  50 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!mcsun!sun4nl!sci.kun.nl!severus.mbfys.kun.nl!gunter
  3. From: gunter@mbfys.kun.nl (Gunter Windau)
  4. Subject: Re: pointers to arrays?!?
  5. Message-ID: <C0p11p.9Et@sci.kun.nl>
  6. Sender: news@sci.kun.nl (News owner)
  7. Nntp-Posting-Host: severus.mbfys.kun.nl
  8. Organization: University of Nijmegen, The Netherlands
  9. References: <1993Jan11.205412.1@cc.newcastle.edu.au>
  10. Date: Mon, 11 Jan 1993 14:17:48 GMT
  11. Lines: 37
  12.  
  13. glgam@cc.newcastle.edu.au (GLGAM) writes:
  14.  
  15.  
  16. >To access a particular element in an array I would use..
  17.  
  18. >ArrayVar[Index] := etc..
  19.  
  20. >Suppose I had setup a pointer to an array on the heap...  How do I access the
  21. >individual elements ?
  22.  
  23. >ie.
  24.  
  25. >Type
  26. >   ArrayType = Array[1..Max] of Char;
  27.  
  28. >Var
  29. >   ArrayVar  : ^ArrayType;
  30. >   Index     : Word;    
  31.  
  32. >[..]
  33.  
  34. >ArrayVar[Index]^ := etc..????
  35. How about:
  36. ArrayVar^[Index] := ...
  37.  
  38. >Doesn't work..  I know why..  I just can't for the life of me figure
  39. >out what _does_ work..
  40.  
  41.  
  42. >Regards,
  43.  
  44. >Scott. 
  45. >        
  46. --
  47. G\"unter Windau                              e-mail: gunter@mbfys.kun.nl
  48. Dept. Medical Physics & Biophysics           voice:        +31 80 617139
  49. Univ. of Nijmegen, The Netherlands           (((()))))))))))))))))))))))
  50.