+ 4
How many elements we can store in the array if we don't mention it's size in C ?
Let's say, int a[] = {1,2,3,4,5........} How many value we can store in it in C ? Also do it work different for different programming languages ?
6 Respuestas
+ 6
You have to provide all values in the {}. Compiler has limits on the program line length and lines count, but they are huge. Also there is a limit on the size of the array itself as a part of the executable, but it is also very huge. Elements count is limited by the size_t type. So, real limit is your computer memory and a storage sizes.
+ 1
Array has limited no. of elements
+ 1
From Javascript-Tutorial:
Creating Arrays
JavaScript arrays are dynamic, so you can declare an array and not pass any arguments with the Array() constructor. You can then add the elements dynamically. You can add as many elements as you need to.
var courses = new Array();
courses[0] = "HTML";
courses[1] = "CSS";
courses[2] = "JS";
courses[3] = "C++";
0
An array is immutable, meaning that you can't change it's inital size. So a[] would have the size of 5.
0
An array is immutable(fixed size ), meaning that you can't change the size of array and update size every time that is the reason.
0
Depend on the size of the array you allotted it.