ADVANCED TOPICS IN COMPILER DESIGN
CODE GENERATION FOR OBJECT ORIENTED LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Assuming int is of 4 bytes, what is the size of int arr[15];?
|
15
|
|
19
|
|
11
|
|
60
|
Explanation:
Detailed explanation-1: -1 Answer. Best explanation: Since there are 15 int elements and each int is of 4bytes, we get 15*4 = 60bytes.
Detailed explanation-2: -Sizeof (arr [0]) means here the elements are integer. So, it takes memory 4 bytes. So, the size of the array = ( 20 / 4 ) bytes = 5 bytes. If we take character array or string instead of integer array, we can explain what happened in the next program.
Detailed explanation-3: -The size of the integer is 4 bytes.
There is 1 question to complete.