Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Dynamic array starting at 1

  1. #11

    Dynamic array starting at 1

    I think 1 based arrays are useful because you can use unsigned integer types to index them, and use 0 to indicate a void index... with 0 based arrays you need signed types, then values lower than -1 are wasted.

  2. #12
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Dynamic array starting at 1

    Thats a very good point. However the counter-balance to that is that when using the index in some calculations, you'll often have to do more work to make it work with a 1-based index. And it doesn't generally look as clean or flow well either.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •