what is the output of the code and how?

main()
{
int *ptr,x;
x=sizeof(ptr);
printf("%d",x);
}

Answer Posted / veluri.haritha

If a compiler is a 16 bit compiler and its memory model is
tiny or small or compact memory model then the "x" value
will be 2 bytes.

if the memory model is large or huge memory model then the
"x" value will be 4 bytes.

if a compiler is a 32 bit compiler then the also the x value
is 4 bytes
by
V.haritha,not yet joined in B.tech

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

571


How can you find the day of the week given the date?

629


Is c still used?

614


What is realloc in c?

585


write a program to copy the string using switch case?

2410






formula to convert 2500mmh2o into m3/hr

509


Explain about the constants which help in debugging?

861


What is memory leak in c?

641


Where define directive used?

615


Explain what are its uses in c programming?

602


What are the usage of pointer in c?

710


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

595


What are preprocessor directives in c?

652


Lists the benefits of c programming language?

606


Why main function is special give two reasons?

961