#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0

    How many values allowed in array?


    I am using two books to learn c++. C++ for dummies, randy davis and Ivor Horton's guide to visual c++ 6. c++ for dummies says you can only have 128 values in an array. ivor horton says you can have unlimmited. can someone clear this up for me?
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    >> c++ for dummies says you can only have 128 values in an array
    This is a bogus statement. You can have as much memory in an array as your compiler/OS will allow. You might want to send the C++ for dummies author a note about this.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Left due to despotic ad-min
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Posts
    1,044
    Rep Power
    14
    Scorpions is correct; the c and C+= standard impose no limits on the size of an array. In practice, the maximum size of an array is often dependent upon the size of a pointer (eg most 32 bit compilers will support array sizes up to at least (2^32-1)/sizeof(type)).

    I've yet to encounter a compiler that *only* allows array sizes of 128.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0

    Talking


    thanks a lot :-D 128 would really be a limit when dealing with large strings.. Thanks!
  8. #5
  9. jasondoucette.com
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    378
    Rep Power
    12

    Re: How many values allowed in array?


    C++ for dummies is a horrible book. It has numerous errors, and will mislead you all the time. Although it is nice to have more than one book to learn from, I recommend sticking with Ivor Horton.

IMN logo majestic logo threadwatch logo seochat tools logo