c++带成员指针使用

下面两种读m_width的方式都ok:

class Rtmp_tool {
public:
int m_width= 0;
int nHeight = 0;
AVCodecContext *c;


};

调用:

Rtmp_tool *rtmp_tool =(Rtmp_tool *) vp;


int Rtmp_tool::*aaa = &Rtmp_tool::m_width;


printf("111 %d %d \n", rtmp_tool->m_width, rtmp_tool->*aaa);

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/80291983
今日推荐