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 will be the output for the following program? main() { char ch = 'k'; char c; printf("%c",c); }

3 Answers  


plz answer.. a program that takes a string e.g. "345" and returns integer 345

4 Answers  


What does the error message "DGROUP exceeds 64K" mean?

0 Answers   Celstream,


The C language terminator is a.semicolon b.colon c.period d.exclamation mark

6 Answers   TCS,


What is call by reference in functions?

1 Answers  






write a program to count the no of repaeted words in a line?

1 Answers  


What are multidimensional arrays?

0 Answers  


How do we make a global variable accessible across files? Explain the extern keyword?

0 Answers  


What are the basic data types associated with c?

0 Answers  


Does c have circular shift operators?

0 Answers  


What is indirection? How many levels of pointers can you have?

0 Answers   Aspire, Infogain,


What is the meaning of this decleration? unsigned char (*pArray[10][10]); please reply.

1 Answers  


Categories