465 views

$\text{prtdata}$ is a pointer to a data type. The expression $^*\text{prtdata}++$ is evaluated as (in C++)

1. $^*(\text{prtdata++})$
2. $(^*\text{prtdata})++$
3. $^*(\text{prtdata})++$
4. Depends on compiler

### 1 comment

Post increment is higher priority than dereference operator.

So it evaluated as *(ptrdata++).

it should be option 1.

Post-increment (++) has higher precedence than dereference (*). Hence it increments the address that the pointer holds, then dereferences it

by
++ and * are unary operators and they have same precedence. The order of evaluation is judged by associativity.

They have right to left associativity so ptrdata ++ is evaluated first then * is applied.

Ans is 1)*(ptrdata++)
by

1 vote