这应该很简单:
我的班级有一个静态 const char* 成员。我想将其初始化为复合字符串。例如:
const char* s_firstPart = "Hello I'm the first part.";
const char* s_secondPart = "I'm the second part.;
struct MyClass
{
static const char* s_theFinalString;
}
const char* MyClass::s_theFinalString = "Here is the string: " \
+ s_firstPart ++ s_secondPart; // obviously this won't compile
我的问题是:有没有办法将 const char* 成员初始化为复合 char 数组?