Sunday 6 January 2008

Pointer question with solution

(q)What will output :
void main()
{
int * p,b;
b=sizeof(p);
printf(“%d”,b);
}
Output: 2 or 4
Explanation:
Since in this question it has not written p is which type pointer. So it’s output will depends upon which memory model has selected. Default memory model is small.
More detail click here
(q)What will be output ?
void main()
{
int huge *a=(int huge *)0x59990005;
int huge *b=(int huge *)

No comments:

Post a Comment