Path: utzoo!attcan!uunet!abvax!iccgcc!yoke From: yoke@astro.pc.ab.com (Michael Yoke) Newsgroups: comp.lang.c Subject: Using Macros Message-ID: <362.26be9dcc@astro.pc.ab.com> Date: 7 Aug 90 15:54:04 GMT Lines: 34 Could some of you give me your opinion on the best way to handle multiple statement macros. For example, let's say that I have a macro that looks like the following: #define A_MACRO (stmt1) and the code that uses the macro looks like this: if (expr) A_MACRO; Now let's say that the macro has to be modified such that it requires more than one statement. If I define the macro like this, #define A_MACRO (stmt1; stmt2;) then all the code using the macro must be changed to if (expr) { A_MACRO; } But, if I define the macro like this #define A_MACRO { stmt1; stmt2; } then the semi-colon at the end of the macro reference screws things up. I guess what I'm really looking for is a good set of guidelines for using macros. Thanks in advance, Mike