Alkali_Guy
asked on
Construct a constant CString?
My MFC code has many declarations like:
const CString error_message = "You made a mistake.";
What does the compiler do with this? Is the string compiled into the code like a const char[]? Or does the compiler just ignore the const and construct a regular CString?
const CString error_message = "You made a mistake.";
What does the compiler do with this? Is the string compiled into the code like a const char[]? Or does the compiler just ignore the const and construct a regular CString?
An CString object will be created just at the beginning of runtime, and will be constant (you can't assign error_message to any other value at runtime)
ASKER
Integral type constants don't receive memory allocation other than in executable code, do they? My question is, if not, do CString objects share this behaviour?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.