ptr.bmx 379 B

1234567891011121314151617181920
  1. Rem
  2. Ptr is a composite type containing a pointer to a variable of the specified Type.
  3. End Rem
  4. ' the following illustrates the use of traditional c style pointers
  5. Local c[]=[1,2,3,4]
  6. Local p:Int Ptr
  7. p=c
  8. Print "pointer 'p' points to:"+p[0] '1
  9. p:+1
  10. Print "pointer 'p' points to:"+p[0] '2
  11. p:+1
  12. Print "pointer 'p' points to:"+p[0] '3
  13. p:+1
  14. Print "pointer 'p' points to:"+p[0] '4