151k views
2 votes
When the less than ( < ) operator is used between two pointer variables, the expression is testing whether ________.

A) the value pointed to by the first is less than the value pointed to by the second
B) the value pointed to by the first is greater than the value pointed to by the second
C) the address of the first variable comes before the address of the second variable in the computer's memory
D) the first variable was declared before the second variable
E) None of these

User Jalasem
by
7.9k points

1 Answer

6 votes

Final answer:

The < operator between two pointers compares their memory addresses to determine which address comes first in memory.

Step-by-step explanation:

When the less than (<) operator is used between two pointer variables, the expression is testing whether the address of the first variable comes before the address of the second variable in the computer's memory. This comparison does not evaluate the values pointed to by the pointers, nor does it consider when the variables were declared. It strictly compares the memory addresses.

User Bgschiller
by
8.4k points