Original Post
🔒 Locked
#define V.S const
Advertisement
In C++, with a decent optimising compiler, const is better. Anything which makes your intentions clearer to the compiler increases the _potential_ for better optimisations.
#define is just a pre-processor macro, what appears in it gets substituted before compilation. The main reason to use #define is if you have a constant which is also used in a C or assembly language program.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
#define is just a pre-processor macro, what appears in it gets substituted before compilation. The main reason to use #define is if you have a constant which is also used in a C or assembly language program.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement