社区
C++ 语言
帖子详情
在线等:How do you call a regular member function from a static member function?
cxq249
2004-11-12 12:43:48
如题。
...全文
145
6
打赏
收藏
在线等:How do you call a regular member function from a static member function?
如题。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
qrlvls
2004-11-12
打赏
举报
回复
an object pointer.
Example:
staticFunc((CClassName*)this);
pObj->m_memberFunc();
qrlvls
2004-11-12
打赏
举报
回复
I will call the member functions by passing a object pointer.
Ailaxya
2004-11-12
打赏
举报
回复
class a{
static void fun(LPARAM param);
void Callfun();
}
void a::CallFun()
{
}
void a::fun(LPARAM param)
{
a *pThis = dynamic_cast<a*>param;
pThis->CallFun();
}
fallhunter
2004-11-12
打赏
举报
回复
to
liuleilover(Vietor)
3,请问静态对象怎么实现?
static么?那还是要用到对象指针吧,请教了
cxq249
2004-11-12
打赏
举报
回复
刚开始学,不太懂。
liuleilover
2004-11-12
打赏
举报
回复
简单,在静态成员函数参数中传递一个类指针就像this。这样静态成员函数就没意义了。:-)
简单2,将那个regular member 定义成静态的。
简单3,将整个类只实现一个静态对象,在静态成员函数中直接引用。
看来是个新手!
Thinking in Java 4th Edition
How a garbage collector works .. 122
Member
initialization ......... 125 Specifying initialization ............. 126 Constructor initialization ... 127 Order of initialization ................ 127 ...
How do I pass a pointer-to-
member
-
function
to a signal handler, X event callback, system call that s
Because a
member
function
is meaningless without an object to invoke it on, you can't do this directly (if The X Window System was rewritten in C++, it would probably pass references to ...
HowTo: Export C++ classes from a DLL
Contents Introduction C Language Approach Handles Calling Conventions Exception Safety Advantages Disadvantages ...C++ Naive Approach: Exporting a Class ...What You See Is Not What Y...
[33] Pointers to
member
function
s
FAQs in section [33]: [33.1] Is the type of "pointer-to-
member
-
function
" different from "pointer-to-
function
"? [33.2] How do I pass a pointer-to-
member
-
function
to a signal handler, X even
Core Data on iOS 5 Tutorial: How To Work with Relations and Predicates
From: ...This is a post by iOS Tutorial Team
member
Cesare Rocchi, a UX designer and developer sp...
C++ 语言
64,649
社区成员
250,477
社区内容
发帖
与我相关
我的任务
C++ 语言
C++ 语言相关问题讨论,技术干货分享,前沿动态等
复制链接
扫一扫
分享
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
请不要发布与C++技术无关的贴子
请不要发布与技术无关的招聘、广告的帖子
请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下
试试用AI创作助手写篇文章吧
+ 用AI写文章