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

Is c++ a pure oop language?

606


What is a static element?

579


What is the c++ code?

570


What is a driver program?

636


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

556






What is #include iostream?

748


Do class declarations end with a semicolon? Do class method definitions?

622


What are inline functions? What is the syntax for defining an inline function?

585


Why should you learn c++?

589


Explain the use of this pointer?

640


Explain the isa and hasa class relationships.

597


What is the use of string in c++?

553


Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.

2444


Why struct is used in c++?

627


What are multiple inheritances (virtual inheritance)?

587