what is the output of the code and how?

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



what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d&q..

Answer / 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

More C Interview Questions

what is the use of pointers

6 Answers   Adobe, GrapeCity,


Table of Sudoku n*n

0 Answers  


what is mean by Garbage collection ? Please answer me. Advance thanks.

4 Answers   Excel,


What is abstract data structure in c?

0 Answers  


What is variables in c?

0 Answers  


main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above

6 Answers  


WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h> #include<conio.h> void main() { int k=20; printf("%d%d%d%d",k,k++,++k,k); getch(); }

25 Answers  


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

0 Answers  


How do you determine the length of a string value that was stored in a variable?

0 Answers  


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

0 Answers  


what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it

5 Answers   DIT,


In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?

4 Answers  


Categories