C Programming - Complicated Declarations - Discussion

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

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

Prabir said:   8 years ago
Simply remember.

*p=2
P=4
**p=4
***p=2
****p=4

Satheesh said:   1 decade ago
Can anyone explain this code in detail?

Bhavana said:   1 decade ago
Can any1 explain me this stuff......:)

Gary said:   9 years ago
Did not understand. Give some more eg.

Prabha said:   9 years ago
Please explain clearly?

Praveen said:   1 decade ago
Can any one explain ?

Saravana kumar said:   1 decade ago
Explain me please.

Plo said:   8 years ago
Thanks @Raj.


Post your comments here:

Your comments will be displayed after verification.