Vidyalelo
C Programming · Q19

C Miscellaneous

Programming · C Programming · question 19

Q19

Determine Output: void main() char *p; p="Hello"; printf("%c", *&*p);

A.
Hello
B.
H
Answer
C.
Some Address will be printed
D.
None of These

Answer: Option B

Solution

Answer: Option B
Solution:

* is a dereference operator & is a reference operator. They can be applied any number of times provided it is meaningful. Here p points to the first character in the string "Hello". *p dereferences it and so its value is H. Again & references it to an address and * dereferences it to the value H.