void main()
{
char far *farther,*farthest;

printf("%d..%d",sizeof(farther),sizeof(farthest));

}




Answers were Sorted based on User's Feedback



void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof..

Answer / surenda pal singh chouhan

4..2

Explanation:
the second pointer is of char type and not a
far pointer

Is This Answer Correct ?    88 Yes 8 No

void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof..

Answer / jaroosh

Some explanation first:
far pointers are outdated concepts from C, and are actually
compiler extentions, so you might get compiler errors trying
to use far pointers on some compilers.
In the program above,
farther's type - FAR pointer to char
farthest's type - near pointer to char
now, the difference in size of those stems from the fact
that far pointers consist of the segment and offset
together, while near pointers just have the offset.
Near pointers thus have size of 2 (just the offset), while
far pointers - size of 4 bytes.

Is This Answer Correct ?    60 Yes 4 No

void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof..

Answer / basha

syntax error before '*' token
error: `farther' undeclared (first use in this function)
error: `farthest' undeclared (first use in this function)

I am getting these types of errors how u get 4 and 2 i
didn't understood

Is This Answer Correct ?    15 Yes 29 No



Post New Answer



More C Interview Questions

How do you list files in a directory?

0 Answers  


Do you know the purpose of 'register' keyword?

0 Answers  


what different between c and c++

1 Answers  


Does * p ++ increment p or what it points to?

0 Answers  


why we use pointer in c

7 Answers   HCL, TCS,






which is conditional construct a) if statement b) switch statement c) while/for d) goto

0 Answers  


write the program for maximum of the following numbers? 122,198,290,71,143,325,98

5 Answers  


if we take a number as a char then can we manipulate(add, subtract) on this number

2 Answers  


Explain pointer. What are function pointers in C?

0 Answers   HCL,


what do you mean by inline function in C?

0 Answers   TCS, IBS,


Is c++ based on c?

0 Answers  


how can f be used for both float and double arguments in printf? Are not they different types?

0 Answers  






Categories