菠萝菠萝菠萝葡萄 2021-04-08 19:45 采纳率: 20%
浏览 33
已采纳

new一个对象 传参this有什么用?

CMaster::CMaster() :
	m_pFpga(nullptr)
	, m_pNotifyQueueListener(new CMasterTcpNotifyQueueListener(this))
	, m_pHeartBeatWaiter(new CHeartBeatWaiter(this))
	, m_pSendDisplayDataQueueListener(new CSendDisplayDataQueueListener(this))
	, m_pImageGenerationQueueListener(new C3DImageGenerationQueueListener(this))
	, m_pMasterCmdReceiver(new CMasterTcpCmdReceiver(this))
	, m_pPlayBackQueueListener(new CPlayBackQueueListener(this))
{
}
  • 写回答

3条回答 默认 最新

  • 关注

    this 就代表这个对象,可以通过this调用对象的成员变量和成员函数

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?