+ 6

what is the base type of an array?

26th Jul 2017, 6:59 AM
Shwati Kumari
Shwati Kumari - avatar
4 Respuestas
+ 11
Well the base type means the type of array. eg int x; this way you create a variable 'x' of type integer. Further if you write int arr[10]; this means the array will be of integer type, each block of the array will occupy 2 bytes then, so here the base type is integer. Means the data type is the base type of the array
26th Jul 2017, 7:10 AM
P R
P R - avatar
+ 4
type of elements of an array is the base type of that array
26th Jul 2017, 7:11 AM
Shwati Kumari
Shwati Kumari - avatar
+ 1
In your program you have to declare to which base type your array belongs : int,float or char etc. if you write char a[20]; Then it means all elements of the array are characters.So base type is char.
26th Jul 2017, 7:09 AM
Lakshay
Lakshay - avatar
+ 1
The array defined by T array[] has type T[]. Basically it is a constant pointer.
26th Jul 2017, 7:46 AM
Denis Felipe
Denis Felipe - avatar