Is there any limit to declare size of an array?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is there any limit to declare size of an array??

What maximum size can i give to an array?? like ; my_array[154628050] //what max size can i provide here? Is it dependent on the machine word length??

23rd Jan 2017, 2:10 AM
Amit Dubey
Amit Dubey - avatar
2 Answers
+ 1
Don't exactly know the maximum limit, but if you declare a very large array, you may get segmentation fault.
13th May 2017, 5:14 AM
Himansh Mulchandani
Himansh Mulchandani - avatar
0
If I am not mistaken, the array size is an int value. The maximum int value is 2^32 which is around 2 Billion(if unsigned)
23rd Jan 2017, 6:04 AM
shay lempert
shay lempert - avatar