R
Rayer
I have got some project src, and find it out that there is no ppl using
"const" to define a constance, but using #define still more. Discussing
with my friend, he said 1. #define is much easier in modify values in
program for several propose, and 2. const takes memory but #define not.
However, most modern textbook (for example, C++ Primal Plus 4/e) still
suggest to use const to replace #define. I know that use #define will
have some problem when using as macro, but that affairs to function, not
const defination. anyone have idea why using const instead of using
#define ? any advantage?
"const" to define a constance, but using #define still more. Discussing
with my friend, he said 1. #define is much easier in modify values in
program for several propose, and 2. const takes memory but #define not.
However, most modern textbook (for example, C++ Primal Plus 4/e) still
suggest to use const to replace #define. I know that use #define will
have some problem when using as macro, but that affairs to function, not
const defination. anyone have idea why using const instead of using
#define ? any advantage?