September 26th, 2003, 10:06 PM
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?
September 26th, 2003, 11:28 PM
>> 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
September 27th, 2003, 02:51 AM
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.
September 27th, 2003, 09:48 AM
thanks a lot :-D 128 would really be a limit when dealing with large strings.. Thanks!
September 27th, 2003, 04:16 PM
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.