- #1
Sumaya
- 29
- 0
hi every one ,
i am new in data structure course
i need help in this :
Compute the addresses of all the elements of array student and show a memory layout for the array if the address of the first element is 0x0012FF1A.
some what i did :
i did account that there is 28 bytes = 1c in hex
and i know that i have to add 1C to the address 0x0012FF1A and i think i'll get 0x0012FF36
my problem is if the first address 0x0012FF1A is the address for the first byte student[0]
so should i keep adding 1C to the previous address until i arrive to student[5]
just wondering and also how it is look like the memory layout . is there 28 bytes between every array like between student[0] and student[1]
thanx alot
i am new in data structure course
i need help in this :
Code:
Struct Person
{
Char name[20];
int id;
float gpa;
};
Person student[5];
Compute the addresses of all the elements of array student and show a memory layout for the array if the address of the first element is 0x0012FF1A.
some what i did :
i did account that there is 28 bytes = 1c in hex
and i know that i have to add 1C to the address 0x0012FF1A and i think i'll get 0x0012FF36
my problem is if the first address 0x0012FF1A is the address for the first byte student[0]
so should i keep adding 1C to the previous address until i arrive to student[5]
just wondering and also how it is look like the memory layout . is there 28 bytes between every array like between student[0] and student[1]
thanx alot
Last edited by a moderator: