You're printing a & b. Value of a and b are not changed. On Wed, Jun 29, 2011 at 3:51 PM, Naveen Kumar <[email protected]> wrote: > Its swapping correctly > Now x is pointing to &b and y is pointing to &a. > > On Wed, Jun 29, 2011 at 3:45 PM, Anika Jain <[email protected]> wrote: >> >> #define FUN(a,b,c) c t; t=a;a=b;b=t; >> >> >> int main() >> { >> int a=2,b=3; >> int *x,*y; >> x=&a,y=&b; >> FUN(x,y,int *); >> printf("%d %d \n",a,b); >> return 0; >> } >> >> >> why doesnt this macro swap pointers wen it can work for variables?? >> >> -- >> 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. >> > > > > -- > Cheers > Naveen Kumar >
-- Cheers Naveen Kumar -- 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.
