C - Data Types - Discussion

You Are Here :: Home > C > Data Types - Discussion

 



Q.

main()

{
char *p;
p="Hello";
printf("%c\n",*&*p);
}

A. Hello B. ello
C. H D. E

Answer: Option C
Explaination:

* 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.



Discussion

Your Comments Goes here...
NameDiscussion