All programs are mainly aware of the size (storage size) of all the primitive forms of data types. Even though the data type’s storage size is pretty constant throughout, it can easily vary when we implement it on various different platforms. For instance, we can perform the allocation of the array space dynamically with the use of the sizeof() operator.
int *ptr= malloc(20*sizeof(int));
In the example given above, we are using the sizeof() operator, and we have applied it to the int cast type. Also, we have used the malloc() function here for the allocation of the memory. It would, in turn, return the pointer pointing towards this memory (allocated memory) in the program. The space of the memory in the program is equivalent to the total bytes that the int data type occupies, multiplied by 20 (as specified in the code).