--- In [email protected], "Sharma, Hans Raj (London)" <hansraj_sha...@...> wrote: > > Proper way of defining > > # define swap(a,b){temp=a;a=b;b=temp;}
No it isn't - the following doesn't compile:
if (i < j) swap(i, j); else printf("no swap\n");
You could put do .. while (0) outside the braces, or add an else after the
closing brace (although that can result in an 'empty else' compiler warning
from gcc), or see:
http://tech.groups.yahoo.com/group/c-prog/message/70718
