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. Advertisements

  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. Advertisements

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,311
    Eliyahu Goldin
    Jun 29, 2005
  2. puzzlecracker
    Replies:
    0
    Views:
    560
    puzzlecracker
    Jan 25, 2006
  3. Rogue Noir
    Replies:
    6
    Views:
    2,624
    Arquebus257WeaMag
    Aug 2, 2003
  4. Bob Day
    Replies:
    1
    Views:
    382
    osmium
    Jul 11, 2003
  5. Mr. 4X
    Replies:
    5
    Views:
    427
    Kenny McCormack
    Jul 16, 2003
  6. gc

    parenthesis

    gc, Oct 16, 2003, in forum: C Programming
    Replies:
    24
    Views:
    1,025
    Richard Bos
    Oct 21, 2003
  7. Oodini
    Replies:
    1
    Views:
    2,083
    Keith Thompson
    Sep 27, 2005
  8. puzzlecracker
    Replies:
    3
    Views:
    941
    puzzlecracker
    Jan 14, 2009
Loading...