I would also like to know how e1.age gets the value 75 ?
Nishant Sinha said:
(Mon, Jan 24, 2011 12:54:49 PM)
Since union makes use of shared memory. So it allocates the memory for datatype which will take highest memory i.e int. So it will allocate 16 bit in turbo c++ and 32 bits in unix compiler. So the character 'k' will be stored in memory as the bit value of 75 as ascii value of k is 75. Since the int is also sharing this memory so it will read the same memory content with a padding of some zeros to make it 2 bytes in turboo or 4 bytes in unix.
Ajay said:
(Wed, Feb 16, 2011 10:07:14 AM)
Please explain in detail.
Maheep Sharma said:
(Wed, Feb 16, 2011 10:44:10 AM)
Why float is not sharing the same memory and not outputting as 75.000000 ?
Archana said:
(Tue, Sep 20, 2011 11:19:57 AM)
Can anyone explain why float doesn't take 75. 000000?
Sona said:
(Thu, Nov 17, 2011 11:39:35 AM)
I think ascii value don't take the float value, so float value is 0.000000.
Rakesh said:
(Fri, Dec 9, 2011 09:01:03 AM)
Please explain in detail.
Nandu said:
(Tue, Dec 27, 2011 12:37:51 AM)
The ascii value of K=75, ascii deosnt take float value so float value z 0.000000 thats it. Once see ascii table it will be easy for you guys.
Asha said:
(Fri, Feb 3, 2012 05:31:49 PM)
Since in union memory of highest datatype is allocated then why the memory of float datatype is allocated? why it has allacated 2 bytes?