N
nilavya
Hi Gurus,
Since I learned C++, way back in 2002, I always had a doubt about the
different types of storage in C++. We have "const", "static" ,
"#define" for one or other purpose. Now I have a eVC++ application
running on WINCE. This application has many classes, some are
initialized dynamically and others statically. I have one class which
has many constant values which does not change. So I have #define 'ed
those variables. But I have read the Code Insection Guidelines, and it
is mentioned that #define shouldnt be used in C++, instead one should
use "const unsigned or signed". What difference does it make in using a
value as "const unsigned" and "#define". How does this affect memory
usage and CPU usage.
Thanks,
With Regards,
Bhagat Nirav K.
Since I learned C++, way back in 2002, I always had a doubt about the
different types of storage in C++. We have "const", "static" ,
"#define" for one or other purpose. Now I have a eVC++ application
running on WINCE. This application has many classes, some are
initialized dynamically and others statically. I have one class which
has many constant values which does not change. So I have #define 'ed
those variables. But I have read the Code Insection Guidelines, and it
is mentioned that #define shouldnt be used in C++, instead one should
use "const unsigned or signed". What difference does it make in using a
value as "const unsigned" and "#define". How does this affect memory
usage and CPU usage.
Thanks,
With Regards,
Bhagat Nirav K.