DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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

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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links