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

Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

0 Answers   TATA, TCS,


Can you explain the four storage classes in C?

0 Answers   TCS,


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

0 Answers  


#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output?

6 Answers   Ramco,


Why calloc is better than malloc?

0 Answers  


Is register a keyword in c?

0 Answers  


what is develop in c language

2 Answers  


create an SINGLE LINKED LISTS and reverse the data in the lists completely

3 Answers  


here is a link to download Let_Us_C_-_Yashwant_Kanetkar

3 Answers   Microsoft,


what is the use of operator ^ in C ? and how it works?

2 Answers  


25. It takes five minutes to pass a rumour from one person to two other persons. The tree of rumour continues. Find how many minutes does it take spread the rumour to 768 persons. ?

11 Answers   CTS, TCS,


Explain what are the standard predefined macros?

0 Answers  


Categories