meaning of the * and & symbol

What do the * and & symbols mean in this code:

  char *p;

What does the printf statement do in the above program? Specifically, what does *&*&p mean?


The printf will print the string "hello" because & is the addressOf operator which will return the address of the pointer followed by it and * is the valueOf operator which will return the value stored in the pointer address followed by it.

So in essence, the statement *&*&p will read


which will return the string "hello" which is stored in the actual location.

Hope this would help you!



Are redundant and you would never encounter such ridiculous code in a real project. The ampersand takes the address of p, and the asterisk * dereferences it to produce the original char*. Back and forth we go...

Think of it as:


As an aside, your type-less signature for main won't cut it on modern compilers where a return type of int is no longer assumed.

Need Your Help

One selected item on a listview

android listview selecteditem

I have made a listview. The plan is that when you select an item, it should appear selected (background color changes) and when you select another one, the one that was selected previously is normal