The answer is Indeterminate ...
Clarification:

pt is the pointer to the struct node s.

so pt may be containing arbit value depending on the actual address for node
s

we have casted pt to short ... i.e 32 bit value to a 16bit value ignoring
its Most significant 16 bits ... so the value of last 16 bit will be printed
which will be different everytime you run the program


On Tue, Sep 13, 2011 at 7:24 PM, Gururajan Raghavendran <
[email protected]> wrote:

> Use vi + gcc, it should be easy. Google it dude......
>
>
> On Tue, Sep 13, 2011 at 7:05 PM, mandy <[email protected]> wrote:
>
>> struct node
>> {
>> char a,b,c;
>> };
>> struct node s={3,5,6};
>> struct node *pt=&s;
>> printf("%d",(short)pt);
>>
>> 1.indeterminate
>> 2.1283
>> 3.5
>> 4.3
>>
>> so what's the right choice and why???
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>



-- 

Saif Hasan | Junior Undergraduate | Computer Science & Engineering | IIT
Bombay

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to