[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

Re: Odd Macro Problem

Shao Miller

5/8/2011 5:02:00 AM

kid joe wrote:
>
> #ifdef INACTIVATE
> #define E(val)
> #else
> #define E(val) printf("%d\n", (val))
> #endif
>

What about:

#ifdef INACTIVE
# define E(val) ((void)(val))
#else
# define E(val) (printf("%d\n", (val)))
#endif

? :)
1 Answer

Harald van D?k

5/9/2011 5:49:00 AM

0

On May 8, 7:01 am, Shao Miller wrote:
> kid joe wrote:
>
> >   #ifdef INACTIVATE
> >   #define E(val)
> >   #else
> >   #define E(val) printf("%d\n", (val))
> >   #endif
>
> What about:
>
>    #ifdef INACTIVE
>    #  define E(val) ((void)(val))
>    #else
>    #  define E(val) (printf("%d\n", (val)))
>    #endif
>
> ? :)

Your solution, while valid, was posted more than three months after
the previous post in the thread, which already suggested the same
thing.