- 1
Arrays
can we give the number of elements (which the array consists) in the bracket int[.....] myArray (name of the array)???
1 ответ
+ 8
yes we can give the number of elements (which the array consists) in the bracket
The size (in brackets) must be an integer literal or a constant variable. The compiler uses the size to determine how much space to allocate (i.e. how many bytes).
Examples:
int list[30]; // an array of 30 integers
char name[20]; // an array of 20 characters
double nums[50]; // an array of 50 decimals
int table[5][10]; // a two dimensional array of integers