Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 30

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 121

Answer:

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


Answer:
H


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


Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 30 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: