![]() |
Representation of ArrayThe representation of an array can be defined by its declaration. A declaration means allocating memory for an array of a given size. ![]() Array Arrays can be declared in various ways in different languages. For better illustration, below are some language-specific array declarations. C++
C
Java
Python
C#
Javascript
![]() Array declaration
Here only a fixed size (i,e. the size that is mentioned in square brackets []) of memory will be allocated for storage, but don’t you think it will not be the same situation as we know the size of the array every time, there might be a case where we don’t know the size of the array. If we declare a larger size and store a lesser number of elements will result in a waste of memory or either be a case where we declare a lesser size then we won’t get enough memory to store the rest of the elements. In such cases, static memory allocation is not preferred. |
Reffered: https://www.geeksforgeeks.org
Arrays |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |