When to use #define and const

Discussion in 'iPad Development' started by NumbLock, Nov 6, 2010.

  1. NumbLock

    NumbLock
    Expand Collapse
    iPad Ninja

    Joined:
    May 2, 2010
    Messages:
    2,008
    Thanks Received:
    32
    Hi Devs,

    I understand that const is a statement and #define is a preprocessor directive, but when should one use one or the other?
     
  2. jychong

    jychong
    Expand Collapse
    iPF Noob

    Joined:
    Dec 18, 2010
    Messages:
    6
    Thanks Received:
    0
    In general if you are going the C++ route and you don't need a preprocessor, const is the way to go since it is cleaner.
     

Share This Page