@atul...mistakenly i have put w at place of t in my last post...i wana say
On Mon, Oct 29, 2012 at 10:07 AM, dCoder <bansal....@gmail.com> wrote: > Just replace your macro with its definition and you will understand. > > its not doing swapping of pointers...plz explain > @dCode i expanded..but its fine...please tell > #include<stdio.h> > #define swap(a,b,c) c t;t=a,a=b,b=t > > int main > int x=10,y=20; > int *p,*q; > swap(x,y,int*); > int * t; t=x; x=y; y=t; There is int* at the end..there is som problem with my keyborad...:(.........acc to me axpanded version is above..but not swapping two pointerss....plz comment > On Sun, Oct 28, 2012 at 9:16 PM, rahul sharma <rahul23111...@gmail.com>wrote: > >> its now doing swapping of pointers...plz explain >> >> >> On Sun, Oct 28, 2012 at 8:08 PM, atul anand <atul.87fri...@gmail.com>wrote: >> >>> it should swap.... >>> >>> On 10/28/12, rahul sharma <rahul23111...@gmail.com> wrote: >>> > Why the following code is not able to swap two macros???although it is >>> > easily swapping 2 variables >>> > >>> > #include<stdio.h> >>> > #define swap(a,b,c) c t;t=a,a=b,b=t >>> > >>> > >>> > int main >>> > >>> > >>> > int x=10,y=20; >>> > int *p,*q; >>> > >>> > swap(x,y,int); >>> > >>> > -- >>> > 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. >>> > >>> > >>> >>> -- >>> 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. >>> >>> >> -- >> 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. >> > > -- > 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. > -- 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.