JackMorris
Technical User
I would like to do following things:
1. Allocate the memory to store 10 integer values.
2. Store the 10 random values in the allocated memory.
3. Get the address of the first value stored. ( The address will be in hexadecimal).
4. Convert the hexadecimal address value into decimal value.
5. Add 4 in the calculated decimal value of the address.
6. The sum should be the address of the second value stored (since the integer occupies 4 bytes) in the allocated memory. The address is still in the decimal value.
7. convert the decimal value into the hexadecimal.
8. Print the value in this address ( as I said earlier this should be the second value in the allocated memory).
Could anyone suggest me how the conversion thing over here could be performed correctly such that I get the right content of the second value in the allocated memory space, if I follow the steps i mentioned above.
thanx in advance.
Jack
1. Allocate the memory to store 10 integer values.
2. Store the 10 random values in the allocated memory.
3. Get the address of the first value stored. ( The address will be in hexadecimal).
4. Convert the hexadecimal address value into decimal value.
5. Add 4 in the calculated decimal value of the address.
6. The sum should be the address of the second value stored (since the integer occupies 4 bytes) in the allocated memory. The address is still in the decimal value.
7. convert the decimal value into the hexadecimal.
8. Print the value in this address ( as I said earlier this should be the second value in the allocated memory).
Could anyone suggest me how the conversion thing over here could be performed correctly such that I get the right content of the second value in the allocated memory space, if I follow the steps i mentioned above.
thanx in advance.
Jack