Hahaha.. Xcellent question Dude.. People Who Know can easily explain.. So for who don't here it is..
It has nothing to do with Endianess Mr.Yogesh.. Actually the bit patter happens to be reside such that ob.ch[0] fills with all ones .. Now as we knw the sign bit concept , here compilers goes mad thinking that the first 1 of 8 consecutive 1's for 255 number as the Sign bit and does the required operation of transforming to equivalent positive integer which happen to be 1.. So as I said no endian here.. if u change the machine than U'll get other -1 .i.e. ch[1]=-1 and again ch[0]=0.. BR, Prem On Thu, Jun 7, 2012 at 11:14 AM, s yogeesh <[email protected]> wrote: > A: 556 > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" 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/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" 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/algogeeks?hl=en.
