how can i initialize static const int member outside class ?
class C
{
public:
C();
private:
static const int a;
static const std::string b;
};
// const int C::a = 4; // i know it
// const std::string C::b = "ba"; // this one too
static
andconst
applied to the same variable?const
.b
that does not work?how can i initialize static const int member outside class ?
besides this option is there another?
You already show how to initialize them outside of the class, why do you look for another option? What do you expect from another option that you can't do with the one you show in your question? What do you not like about the one you already know?