If a function is declared as void fn(int *p), then which of the following statements is valid to call function fn?
A. fn(x) where x is defined as int x;
B. fn(x) where x is defined as int *x;
C. fn(&x) where x is defined as int *x;
D. fn(*x) where x is defined as int *x;
Answer:B
If a function is declared as void fn(int *p), then which of the following statements is valid to call function fn?
A. fn(x) where x is defined as int x; B. fn(x) where x is defined as int *x; C. fn(&x) where x is defined as int *x; D. fn(*x) where x is defined as int *x;
Explanation: Function void fn(int *p) needs pointer to int as argument. When x is defined as int *x, then x is pointer to integer and not *x.