A

Admin • 833K Points
Coach

Q. Determine Output

Code:
void main()
{
char *p;
p="Hello";
printf("%c", *&*p);
}
  • (A) Hello
  • (B) H
  • (C) Some Address will be printed
  • (D) None of These
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

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

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.