I\'d like to define a constant char* in my header file for my .cpp file to use. So I\'ve tried this:
private:
static const char *SOMETHING = \"sommething\";
class A{
public:
static const char* SOMETHING() { return "something"; }
};
I do it all the time - especially for expensive const default parameters.
class A{
static
const expensive_to_construct&
default_expensive_to_construct(){
static const expensive_to_construct xp2c(whatever is needed);
return xp2c;
}
};