0
what is the output of the program in Turbo C (in DOS 16-bit OS)? answer is 2,4,4. but i didnt understand this... anyone plz e
// anyone plz expain this prgram hpw the answer will be 2,4,4 #include<stdio.h> int main() { char *s1; char far *s2; char huge *s3; printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3)); return 0; }
1 Answer
+ 3
your program exists in a memory segment, so the pointer is the offset from the base address of the segment. a far pointer stores both the base address of the segment and the offset, being able to address memory arias outside the program segment. far and huge are synonyms
https://en.m.wikipedia.org/wiki/X86_memory_segmentation