<分区>
Possible Duplicate:
What is this weird colon-member syntax in the constructor?
我需要知道这段代码的含义:
Cman::Cman() :
m_pThread (NULL) //m_pThread is pointer to other class
{
}
我真的不明白这段代码。
这个 NULL
是什么意思?
我可以将它用作常规构造函数吗?
标签 c++ constructor
<分区>
Possible Duplicate:
What is this weird colon-member syntax in the constructor?
我需要知道这段代码的含义:
Cman::Cman() :
m_pThread (NULL) //m_pThread is pointer to other class
{
}
我真的不明白这段代码。
这个 NULL
是什么意思?
我可以将它用作常规构造函数吗?
最佳答案
它说在执行构造函数中的代码之前将m_pThread
初始化为NULL。
关于c++ - C++ 构造函数定义中冒号后面的这个奇怪的东西是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4949846/