---------- Forwarded message ----------
From: Rajesh Kumar <[email protected]>
Date: Sun, Oct 9, 2011 at 2:58 PM
Subject: why we can not swap values using macro?
To: [email protected]
why this code doesn't swap values of x and y?
#include<stdio.h>
#define swap(a,b,c) c t;t=a,a=b,b=t;
main()
{
float x=10,y=20;
float *p,*q;
p=&x,q=&y;
swap(p,q,float *);
printf("%d %d\n",x,y);
}
--
Regards
Rajesh Kumar
--
Regards
Rajesh 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.