What is the Maximum Size that an Array can hold?
Answer Posted / chandra
On Windows platform (32 bit) the max array size is FFFFFFFF.
so if you give int arr[0x3FFFFFFF]; it works in VC++.
and if you try arr[0x40000000]; it gives following error:
error C2148: total size of array must not exceed ffffffff
bytes
We came to this value(3FFF FFFF) by dividing FFFFFFFF (2
power 32) by 4 because each int is 4 byte. so for char
array this value will be full FFFF FFFF.
Is This Answer Correct ? | 54 Yes | 7 No |
Post New Answer View All Answers
How do I start a c++ project?
Difference between declaration and definition of a variable.
What do you mean by function and operator overloading in c++?
What is polymorphism and its type in c++?
Do you know what are pure virtual functions?
Write about the role of c++ in the tradeoff of safety vs. Usability?
What is the use of string in c++?
What is called array?
Can member functions be private?
Differentiate between the manipulator and setf( ) function?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
Do you know about latest advancements in C++ ?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
What are the comments in c++?