Re: [algogeeks] Re: why we can not swap values using macro?

2011-10-19 Thread Wasif Hossain
@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

Re: [algogeeks] Re: why we can not swap values using macro?

2011-10-11 Thread prasad jondhale
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

[algogeeks] Re: why we can not swap values using macro?

2011-10-10 Thread sravanreddy001
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