Redirected
edited by
779 views
0 votes
0 votes

$\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
edited by

2 Answers

1 votes
1 votes

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

answer will be *(ptrdata++)

0 votes
0 votes
++ 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++)
Answer:

Related questions

1 votes
1 votes
2 answers
1
Arjun asked Nov 5, 2017
3,067 views
Which speed up could be achieved according to Amdahl's Law for infinte number of processes if $5\%$ of a program is sequential and the remaining part is ideally parallel?...
0 votes
0 votes
1 answer
2
Arjun asked Nov 5, 2017
2,519 views
Which of the given wireless technologies used in IoT, consumes the least amount of power?ZigbeeBluetoothWi-FiGSM/CDMA
0 votes
0 votes
2 answers
3
Arjun asked Nov 5, 2017
4,592 views
Which of the following is not a Clustering method?K-Means methodSelf Organizing feature map methodK- nearest neighbor methodAgglomerative method