0
在構造函數類中初始化我的靜態成員變量是否合適?適當的位置來初始化靜態成員變量的值
// CFoo.h
class CFoo
{
public:
CFoo();
~CFoo();
static std::string str;
};
// CFoo.cpp
CFoo::CFoo()
{
str = "HELLO";
}
CFoo::~CFoo()
{
}
感謝
http://stackoverflow.com/questions/185844/initializing-private-static-members –