56.7k views
0 votes
If a variable uses more than one byte of memory, for pointer purposes its address is ________.

A) the address of the last byte of storage
B) the average of the addresses used to store the variable
C) the address of the first byte of storage
D) general delivery
E) None of these

User Cvng
by
8.0k points

1 Answer

1 vote

Final answer:

The correct answer is C) the address of the first byte of storage. This is the standard way of referencing multi-byte variables in programming, allowing the system to read the full value from this starting point.

Step-by-step explanation:

When dealing with variables in programming that occupy more than one byte of memory, the address that is usually used for pointer purposes is the address of the first byte of storage. This means that the correct answer to the question is C) the address of the first byte of storage. The system knows the data type of the pointer and will read the appropriate number of bytes from the starting address to get the entire value of the variable.

For example, in a system where an integer is four bytes long, if an integer variable is stored at memory address 1000, then a pointer to that integer would point to address 1000, not to 1001, 1002, or 1003, where the other bytes of the integer are stored.

User Serhii Kushchenko
by
8.4k points