作业帮 > 综合 > 作业

下面public:处,如何理解,求指点~!

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/06/11 04:10:56
下面public:处,如何理解,求指点~!
class PlayerPrepare: public PlayerCommand
{
public:
PlayerPrepare(media_completion_f cbf, void* cookie) :
PlayerCommand(PLAYER_PREPARE, cbf, cookie) {}
};
public://指示下面的方法的访问权限是公共的
PlayerPrepare(media_completion_f cbf,void* cookie) :
PlayerCommand(PLAYER_PREPARE,cbf,cookie) {}
冒号之前是继承类的构造函数,冒号后面是对基类构造函数的赋值.
再问: 那冒号起什么作用呢?
再答: 冒号是C++固定格式,用形参列表对基类构造函数赋值