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


Please Help Members By Posting Answers For Below Questions

How do I start a c++ project?

579


Difference between declaration and definition of a variable.

581


What do you mean by function and operator overloading in c++?

601


What is polymorphism and its type in c++?

578


Do you know what are pure virtual functions?

636






Write about the role of c++ in the tradeoff of safety vs. Usability?

582


What is the use of string in c++?

539


What is called array?

613


Can member functions be private?

587


Differentiate between the manipulator and setf( ) function?

586


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

542


Do you know about latest advancements in C++ ?

650


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

734


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

528


What are the comments in c++?

563