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

What is c++ w3school?

849


Why c++ is called oop?

847


What is an accessor in c++?

815


What is the benefit of c++?

793


How can you specify a class in C++?

1005


What is constant in c++ with example?

846


What do you mean by early binding?

783


Define whitespace in C++.

953


Mention the ways in which parameterized can be invoked. Give an example of each.

785


What is ios flag in c++?

871


Define stacks. Provide an example where they are useful.

770


Is C++ case sensitive a) False b) Depends on implementation c) True

798


Why iomanip is used in c++?

844


Does c++ have finally?

741


Discussion on error handling of C++ .

841