Q
qazmlp
As I understand, there will be 100 copies of "myTestClass", when
CLASSNAME is declared as below:
#define CLASSNAME "myTestClass"
But, there will be only 1 copy of "myTestClass", when
CLASSNAME is declared as below:
const char* CLASSNAME = "myTestClass" ;
Is my understanding correct ? Isn't that an advantage of 'const'
over '#define' declaration for constants?
CLASSNAME is declared as below:
#define CLASSNAME "myTestClass"
But, there will be only 1 copy of "myTestClass", when
CLASSNAME is declared as below:
const char* CLASSNAME = "myTestClass" ;
Is my understanding correct ? Isn't that an advantage of 'const'
over '#define' declaration for constants?