Re: plz analyze the o/p ?
From: xarax (xarax_at_email.com)
Date: 08/01/04
- Next message: David Hopwood: "Re: lastest C standard version"
- Previous message: Sameh Halabi: "insufficient algorithm"
- In reply to: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Next in thread: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Reply: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 01 Aug 2004 14:51:02 GMT
"Emmanuel Delahaye" <emdel@YOURBRAnoos.fr> wrote in message
news:mn.0a5b7d48f267b482.15512@YOURBRAnoos.fr...
> Till Crueger wrote on 01/08/04 :
> > wouldn't this work even better
> >
> > #define SWAP(a, b, type) \
> > do { \
> > type temp = (a); \
> > (a) = (b); \
> > (b) = temp; \
> > } while (0)
> >
> > It expands correctely on my compiler, but should it?
>
> Yes, this is probably the most versatile and safe solution.
Unless "temp" is a conflicting name in an outer scope.
I would prefer passing just the type name.
-- ---------------------------- Jeffrey D. Smith Farsight Systems Corporation 24 BURLINGTON DRIVE LONGMONT, CO 80501-6906 http://www.farsight-systems.com z/Debug debugs your Systems/C programs running on IBM z/OS for FREE!
- Next message: David Hopwood: "Re: lastest C standard version"
- Previous message: Sameh Halabi: "insufficient algorithm"
- In reply to: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Next in thread: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Reply: Emmanuel Delahaye: "Re: plz analyze the o/p ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|