OOPS
August 29, 2024OOPS
August 29, 2024OOPS
|
Question 65
|
‘ptrdata’ is a pointer to a data type. The expression *ptrdata++ is evaluated as (in C++) :
|
*(ptrdata++)
|
|
|
(*ptrdata)++
|
|
|
* (ptrdata) ++
|
|
|
Depends on compiler
|
Question 65 Explanation:
Normally ++ having higher precedence than * but both are unary operators in C++.
So, the precedence ptrdata++ will evaluate first. So, we are given parenthesis (ptrdata++).
Second precedence is * and finally *(ptrdata++)
So, the precedence ptrdata++ will evaluate first. So, we are given parenthesis (ptrdata++).
Second precedence is * and finally *(ptrdata++)
Correct Answer: A
Question 65 Explanation:
Normally ++ having higher precedence than * but both are unary operators in C++.
So, the precedence ptrdata++ will evaluate first. So, we are given parenthesis (ptrdata++).
Second precedence is * and finally *(ptrdata++)
So, the precedence ptrdata++ will evaluate first. So, we are given parenthesis (ptrdata++).
Second precedence is * and finally *(ptrdata++)
