Tuesday 2 September 2008

Huge pointer question with solutions

What will be output ?
void main()
{
int huge *a=(int huge *)0x59990005;
int huge *b=(int huge *)0x59980015;
if(a==b)
printf("power of pointer");
else
printf("power of c");
getch();
}
Output: power of pointer
Explanation:
Here we are performing relational operation between two huge address. So first both a and b will normalize.
a=(0x5999)* (0x10)+(0x0005)=0x9990+0x0005=0x9995
b=(0x5998)* (0x10)+(

No comments:

Post a Comment