What do the * and & symbols mean in this code:
#include<stdio.h>
main()
{
char *p;
p="hello";
printf("%s\n",*&*&p);
}
What does the printf statement do in the above program? Specifically, what does *&*&p mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
printfwill print the string"hello"because&is theaddressOfoperator which will return the address of the pointer followed by it and*is thevalueOfoperator which will return the value stored in the pointer address followed by it.So in essence, the statement
*&*&pwill readvalueOf(addressOf(valueOf(addressOf(p))))which will return the string
"hello"which is stored in the actual location.Hope this would help you!