Asked by Katelyn Sauber on Jun 24, 2024
Verified
The expression ____ adds 3 to "the variable pointed to by gPtr."
A) *(gPtr + 3)
B) *gPtr + 3
C) gPtr + 3
D) &gPtr + 3
Variable Pointed
Refers to the specific variable or memory location that a pointer variable is currently pointing to.
Indirection Operator
A symbol used in programming (commonly the asterisk * in C/C++) to access the value at a memory address pointed to by a pointer variable.
Pointer
A variable in C and C++ that stores the memory address of another variable, allowing for direct memory manipulation.
- Differentiate between pointer arithmetic and array indexing.
Verified Answer
MS
Mohammad SaqlainJun 27, 2024
Final Answer :
B
Explanation :
The correct expression is "*gPtr + 3" which dereferences the pointer gPtr to get the value it points to and then adds 3 to that value.
Learning Objectives
- Differentiate between pointer arithmetic and array indexing.