【发布时间】:2011-06-24 09:43:42
【问题描述】:
可能重复:
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 的初始化在初始化列表中完成,更多信息请参见parashift.com/c++-faq-lite/ctors.html#faq-10.6。
标签: c++ constructor