Logical Size of an Array


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Logical Size of an Array

  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Logical Size of an Array

    Hey, Im a newbie and was wondering how to find the logical size of an integer array using a for loop. Thanks

  2. #2
    Join Date
    Sep 2004
    Posts
    223
    well ever array has the attribute array.length this will return the arrays length. However, remember that if it returns 4 then the array only has elements:
    0 1 2 and 3
    NOT 4

    If you were to use a for loop you would need to use this attribute to set the number of iterations that the for loop does. Otherwise you would get the out of bounds excpetions
    A kram a day keeps the doctor......guessing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center