Call Support +91-85588-96644
TCYonline

Login

Sign Up

Please enter a Username or Email ID
Please enter a password
Keep me logged in
Please enter your name
Please enter your mobile number
You can't leave Captcha Code empty
By submitting this form, you agree to the Terms & Privacy Policy.
OR

Sign Up via Facebook

Sign Up via Google

Sign Up via Twitter

Download Software
Tests given

Download TCY App

App Image

What will be the output of the following function?

main()
{
char *p;
printf(%d %d ,sizeof(*p),sizeof(p));
}

 
12
22
11
None of these

Reply


Please type your answer before submitting.
Submit

While compiling above program I get 18 as output and some warning: { ques18.c: In function ‘main’: ques18.c:5:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] printf("%d %d", sizeof(*p),sizeof(p)); ^ ques18.c:5:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=] printf("%d %d", sizeof(*p),sizeof(p)); } can you plz explain this