What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

When to use #define and const

NumbLock

iPF Novice
Joined
May 2, 2010
Messages
2,008
Reaction score
32
Location
Switzerland
Hi Devs,

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

jychong

iPF Noob
Joined
Dec 18, 2010
Messages
6
Reaction score
0
Location
Sg
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.
 

Most reactions

Latest posts

Top