C Programming - Complicated Declarations - Discussion

Discussion Forum : Complicated Declarations - Find Output of Program (Q.No. 11)
11.
What will be the output of the program?
#include<stdio.h>

int main()
{
    char huge *near *ptr1;
    char huge *far *ptr2;
    char huge *huge *ptr3;
    printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    return 0;
}
4, 4, 8
2, 4, 4
4, 4, 2
2, 4, 8
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
13 comments Page 2 of 2.

Krishna said:   1 decade ago
What about the * an ptr. ?

Peheli said:   1 decade ago
I didn't understand, please clarify the answer.

Malathi said:   1 decade ago
The near have the 2 byte values, far and huge have 4 byte values.


Post your comments here:

Your comments will be displayed after verification.