cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Is #define different from const int
Is #define different from const int
Apr 24, 2016 at 5:16pm UTC
jgg2002
(217)
If you define a variable, rather than declare it as a constant, is there any difference.
For example is A different than B?
1
2
#define A 1000
const
int
B = 1000;
Last edited on
Apr 24, 2016 at 5:17pm UTC
Apr 24, 2016 at 5:36pm UTC
JLBorges
(13770)
See: 'Why would I use a const variable / const identifier as opposed to #define?'
https://isocpp.org/wiki/faq/newbie
Topic archived. No new replies allowed.