C Programming - Pointers - Discussion

Discussion Forum : Pointers - Find Output of Program (Q.No. 17)
17.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    char *p;
    p="hello";
    printf("%s\n", *&*&p);
    return 0;
}
llo
hello
ello
h
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
37 comments Page 3 of 4.

Sharanu hugar said:   1 decade ago
Thanks shamini....but u have to use printf instead of scanf..

Rajan said:   8 years ago
*p will give run time error, p will print hello.

Amar dengale said:   7 years ago
Hi, I am not getting this. Explain the question.

Akash said:   1 decade ago
Very nice explanation Rajesh. Its conceptual.

Sakshi Munya said:   6 years ago
Very nice explanation. Thanks @Deepu.

Abhijeet said:   9 years ago
Very helpful, Thanks everyone.

Deepika said:   9 years ago
Very well explained @Deepu.

Raj said:   1 decade ago
Good explanation rajesh.

Ravi said:   2 decades ago
Please explain this.

Irisident said:   8 years ago
Thanks @Shamini.


Post your comments here:

Your comments will be displayed after verification.