Declarations and Initializations - Find Output of Program :: Discussion


4.What is the output of the program in Turbo C (in DOS 16-bit OS)?
A.2, 4, 6
B.4, 4, 2
C.2, 4, 4
D.2, 2, 2
Answer:  Option  C
Explanation:

Any pointer size is 2 bytes. (only 16-bit offset)
So, char *s1 = 2 bytes.
So, char far *s2; = 4 bytes.
So, char huge *s3; = 4 bytes.
A far, huge pointer has two parts: a 16-bit segment value and a 16-bit offset value.

Since C is a compiler dependent language, it may give different output in other platforms. The above program works fine in Windows (TurboC), but error in Linux (GCC Compiler).

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers