The contents of two pointers that point to adjacent of type float differ by

one bytes
two bytes
three bytes
four bytes

The correct answer is B. two bytes.

A pointer is a variable that stores the address of another variable. In C++, the size of a pointer is always 4 bytes, regardless of the type of the variable it points to. This is because pointers are stored in memory as integers, and the size of an integer is always 4 bytes on a 32-bit system.

Therefore, the contents of two pointers that point to adjacent elements of type float will differ by 2 bytes, since each float takes up 4 bytes of memory.

Option A is incorrect because a byte is the smallest unit of addressable memory in a computer. A pointer is not a byte, but rather a variable that stores the address of another variable.

Option C is incorrect because a float takes up 4 bytes of memory, not 3 bytes.

Option D is incorrect because a pointer is always 4 bytes, regardless of the type of the variable it points to.

Exit mobile version