I once answered a similar question in stackoverflow.com http://stackoverflow.com/questions/8586722/comparing-unsigned-char-and-eof/8586867#8586867 Hope it helps... Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com
On Sun, Jan 29, 2012 at 6:54 PM, Firoz Khursheed <[email protected]>wrote: > http://ideone.com/5uhz1 > it seems that > -ve number is always converted to unsigned, but this time x=3 is greater > why? > > > On Sun, Jan 29, 2012 at 3:14 PM, Saurabh Yadav <[email protected]>wrote: > >> may be because when you compare unsigned number with signed number ,the >> signed will changed to unsigned type and when signed will changed to >> unsigned type, it's MSB is one ,so y will be greater than x >> >> i am not sure about the reason i gave !! >> >> >> On Sun, Jan 29, 2012 at 2:25 PM, Ashish Sachdeva < >> [email protected]> wrote: >> >>> http://ideone.com/Ily5v >>> >>> -- >>> 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. >>> >>> >> >> >> -- >> Thanks & Regards >> Saurabh Yadav >> >> -- >> 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. > -- 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.
