Is it possible to declare a string at all in a header (.h) file, in the definition of a Class?
When I want to set a default int
, I do:
class MyClass
{
static const unsigned int kDATA_IMAGE_WIDTH = 1024;
Is there a way to do the same for the string
object?
class MyClass
{
static const string kDEFAULT_FILE_EXTENSION = "png"; // fail
I know I can use #define
...
#define kDEFAULT_FILE_EXTENSION "png"
thanks
edit: added that it is in a class definition. updated examples.