Welcome to iPadForums.net Guest - Click Here to Register

When to use #define and const

This is a discussion on When to use #define and const within the iPad Development forums, part of the iPad App Store category; Hi Devs, I understand that const is a statement and #define is a preprocessor directive, but when should one use one or the other?...

Register with iPad Forums
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    iPad Ninja
    Member #
    3495
    Liked
    5 times
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    2,024

    When to use #define and const

    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. #2
    iPad Fan!
    Member #
    25041
    Join Date
    Dec 2010
    Location
    Sg
    Posts
    7
    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.


Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search tags for this page

compiler directive check ipad
,
directive.com/ipad
,
how to define const in ipad
,
ipad #define preprocessor
,
ipad const define
,

ipad preprocessor

,

preprocessor define ipad

,
preprocessor for ipad checking
,
when to use define over const
Click on a term to search for related topics.