*ptrdata is a pointer to a data type. The expression *ptrdata++ is evaluated…

2022

*ptrdata is a pointer to a data type. The expression *ptrdata++ is evaluated as (C++) –

  1. A.

    *(ptrdata++)

  2. B.

    (*ptrdata)++

  3. C.

    *(ptrdata)+

  4. D.

    Depends on compiler

Attempted by 199 students.

Show answer & explanation

Correct answer: A

The correct option is Option 1.

In C++, different operators have different "priority" levels (precedence).

  1. Priority: The ++ (postfix increment) has higher priority than the * (dereference).

  2. How it works: Because ++ has higher priority, it "grabs" the pointer first.

  3. The Result: The computer first deals with the pointer's address (ptrdata++) and then looks at the value inside that address (*).

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs