@prasad jondhale: +1
Thanx.
Wasif Hossain
Final Semester Student,
Computer Science and Engineering(CSE),
Bangladesh University of Engineering and Technology(BUET)
Dhaka, Bangladesh.
On Wed, Oct 12, 2011 at 3:47 AM, prasad jondhale
jondhale.pra...@gmail.comwrote:
hey man u have made a very
hey man u have made a very silly mistakeyou have swaped only pointers
not values.
#includestdio.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(%f %f\n,*p,*q);
}
gives result 20.00 10.00
if want to change values of
The swap is happenning between the p q pointers,
https://ideone.com/4MdX4
p points to y, q points to x after swap.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit