@Shivam: Your one-line "solution" violates the sequence point rule. Hence, it is non-standard, and the result is compiler dependent. Dave
On Monday, November 5, 2012 9:36:12 AM UTC-6, Shivam...aka Bboy rullz....... wrote: > in a single line > a^=b^=a^=b; > > On 05/11/2012, atul anand <atul.8...@gmail.com <javascript:>> wrote: > > a=a^b; > > b=a^b; > > a=a^b; > > > > need to check if a and b are equal or not , bcozz a^a =0 > > > > On Mon, Nov 5, 2012 at 2:02 AM, manish <narayan...@gmail.com<javascript:>> > wrote: > > > >> Swapping two objects (not integers/chars),without using temp...? > >> my solution is using xor operation..is that right and ny other > solutions > >> ? > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Algorithm Geeks" group. > >> To view this discussion on the web visit > >> https://groups.google.com/d/msg/algogeeks/-/OxVSnZ1QjzMJ. > >> To post to this group, send email to > >> algo...@googlegroups.com<javascript:>. > > >> To unsubscribe from this group, send email to > >> algogeeks+...@googlegroups.com <javascript:>. > >> 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 algo...@googlegroups.com<javascript:>. > > > To unsubscribe from this group, send email to > > algogeeks+...@googlegroups.com <javascript:>. > > 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 view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/17FE1cYGsVcJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.