What is the Maximum Size that an Array can hold?

Answers were Sorted based on User's Feedback



What is the Maximum Size that an Array can hold?..

Answer / narendra nagesh

it's depends upon the ram mamory.

Is This Answer Correct ?    99 Yes 41 No

What is the Maximum Size that an Array can hold?..

Answer / 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

What is the Maximum Size that an Array can hold?..

Answer / susheel gurjar

it is dapand upon compiler to complier

Is This Answer Correct ?    45 Yes 35 No

What is the Maximum Size that an Array can hold?..

Answer / rajat paliwal

Actually it depends on which mode you are programming.
if ur workin in normal c complier i.e. in dos (16 bit)
then maximum size for
char-> 65535
int ->65535/2=32767
float->32767/2=16382
..
however if you are working in 32 bit operating enviroment
like in VC++
then the maximum size for char = 2 raisec to power 32..
like that..

Is This Answer Correct ?    14 Yes 4 No

What is the Maximum Size that an Array can hold?..

Answer / reejusri

Maximum size has nothing to do with only the stack area,
but the area where the array is allocated from. The OP did
not say whether the array was created from dynamic memory
(a.k.a the heap), block or local memory (a.k.a. the stack),
or where automatic variables are declared.

The amount of memory available depends on:
1. The total memory on the platform.
2. The amount of memory allocated to the program.
3. The compiler's settings.

Is This Answer Correct ?    17 Yes 9 No

What is the Maximum Size that an Array can hold?..

Answer / depak patel

it depand upon operating system to oprating system

Is This Answer Correct ?    37 Yes 32 No

What is the Maximum Size that an Array can hold?..

Answer / adnan sheikh

max.size of array is 2^32

Because each process contains:
maximum numbers of segments per process=16KB
largest segment size= 4GB
defines in 32 bits
Types of segments are:
data segment
code segment
stack segment
heap segment and many more.

Hopefully we will satisfies with my answer.

Is This Answer Correct ?    6 Yes 3 No

What is the Maximum Size that an Array can hold?..

Answer / prasant

It depends on the stack size. If the compiler option is
chosen as default then the default stack size is 1MB and an
array can be allocated upto 1MB size. If the array size
exceeds this limit then the program will throw stack
overflow error.

Is This Answer Correct ?    16 Yes 15 No

What is the Maximum Size that an Array can hold?..

Answer / sankalp bose

For arrays allocated on the stack, it depends upon the
maximum stack size. For example, for gcc, it is normally 64K
but may be something else. For arrays allocated dynamically
or arrays defined in global/static scope, this number is
different and depends upon the maximum heap area size and
the maximum data segment size respectively. The getrlimit
system call can be used to get all these values.

Is This Answer Correct ?    3 Yes 2 No

What is the Maximum Size that an Array can hold?..

Answer / ajay

it depend upon sizeof int

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C++ General Interview Questions

What is the difference between reference and pointer?

0 Answers  


How the delete operator differs from the delete[]operator?

0 Answers  


What is else syntax in c++?

0 Answers  


What are the implicit member functions of class?

0 Answers  


Any one help me plzzzz..... i have an assignment...... that is ______*********_______ Write a program that takes an equation as a string and does the following: Solve 8 parts to achieve 100% 1 - 5 are compulsory. Input: 2x^2+3x+4=0 1) read a quadratic equation 2) print its coefficients (coefficients range is 0 to 9) 3) print the solution of the equation 4) tackle imaginary solution e.g. ( (2+3i), (2-3i) ) 5) allow spaces within the input 6) after solving one equation; ask for an other, terminate on empty line. * 7) tackle negative values as well * 8) tackle more than one values of same exponent (e.g. 2x^2 + 3x^2 + 4x + 3 = 0)* 9) use strtok * 10) print the solution in fractions e.g. 1.5 should be printed as (1)1/2 * 11) coefficient can be greater than 9** 12) values on both sides of the ‘=’ sign** 13) plot the graph of the polynomial** 14) use a compiler other than Borland** 15) submit before May 25, 2009 11:59 PM ** _______******________ plz send me c++ code at sweety.alvi@gmail.com

1 Answers  


Why Pointers are not used in C++?

0 Answers   Global Logic,


What is a driver program?

0 Answers  


What is difference between malloc()/free() and new/delete?

0 Answers  


What is increment operator in c++?

0 Answers  


What is function overloading c++?

0 Answers  


Why ctype h is used in c++?

0 Answers  


What are static type checking?

0 Answers  


Categories