Whats the logic behind
**a^=*b;*
**b^=*a;*
**a^=*b;*
??

On Sun, Jul 31, 2011 at 7:19 PM, rajeev bharshetty <rajeevr...@gmail.com>wrote:

> *#include<stdio.h>*
> *int main()*
> *{*
> *int i=10;*
> *int j=20;*
> *int *a,*b;*
> *a =&i;*
> *b=&j;*
> *printf("before""%d%d\n",*a,*b);*
> **a^=*b;*
> **b^=*a;*
> **a^=*b;*
> *printf("after""%d%d",*a,*b);*
> *return 0;*
> *}*
> *
> *
> *This swaps pointers .... *
>
>  On Sun, Jul 31, 2011 at 7:15 PM, Nikhil Gupta 
> <nikhilgupta2...@gmail.com>wrote:
>
>>  How to swap two pointers without using a temporary pointer ?
>>
>> --
>> Nikhil Gupta
>> Senior Co-ordinator, Publicity
>> CSI, NSIT Students' Branch
>> NSIT, New Delhi, India
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> 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.
>>
>
>
>
> --
> Regards
> Rajeev N B <http://www.opensourcemania.co.cc>
>
> "*Winners Don't do Different things , they do things Differently"*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> 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.
>



-- 
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
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.

Reply via email to