Using parenthesis with defined (#if defined(...))

Discussion in 'C++' started by Angel Tsankov, Apr 5, 2006.

  1. Is there any reason why I would ever want to use parenthesis with defined:

    #if defined(A_MACRO_NAME)
    Angel Tsankov, Apr 5, 2006
    #1
    1. Advertising

  2. Angel Tsankov wrote:
    > Is there any reason why I would ever want to use parenthesis with
    > defined:
    > #if defined(A_MACRO_NAME)


    I use parentheses if more than one macro needs to be tested:

    #if defined(A) && defined(B)

    It's not necessary, but it reads better.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Apr 5, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .Net Sports
    Replies:
    4
    Views:
    2,119
    Eliyahu Goldin
    Jun 29, 2005
  2. puzzlecracker
    Replies:
    0
    Views:
    445
    puzzlecracker
    Jan 25, 2006
  3. Rogue Noir
    Replies:
    6
    Views:
    2,435
    Arquebus257WeaMag
    Aug 2, 2003
  4. Oodini
    Replies:
    1
    Views:
    1,767
    Keith Thompson
    Sep 27, 2005
  5. puzzlecracker
    Replies:
    3
    Views:
    738
    puzzlecracker
    Jan 14, 2009
Loading...

Share This Page