+1 umer .. question is to swap for objects .. how do u define '+' on objects(which may contain any type, even dynamic memory allocation).
On Mon, Nov 5, 2012 at 9:06 PM, Shivam Rohilla < [email protected]> wrote: > in a single line > a^=b^=a^=b; > > On 05/11/2012, atul anand <[email protected]> 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 <[email protected]> > 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 [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. > > -- 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.
