回调函数的实现
时间:2010-12-25 来源:unixeye
#include<stdio.h> #include<string.h>
typedef void (* pFunc)(char* s, int n);
void Caller(pFunc Func, char* s, int n) { Func(s, n); }
void func(char* s, int n) { printf("sName0 = %s\r\n", s); memset(s, 0x00, n); strcpy(s, "wo hao xiang ni!"); }
int main() { char buff[32] = {0}; strcpy(buff, "ni xiang wo ma?"); Caller(func, buff, 32); printf("sName1 = %s\r\n",buff); return 0; }
相关阅读 更多 +
- 系统休眠文件删除后果 如何删除计算机的休眠文件 2025-04-22
- 站群服务器是什么意思 站群服务器的作用 站群服务器和普通服务器的区别 2025-04-22
- jQuery插件有何作用 jQuery插件的使用方法 2025-04-22
- jQuery插件有哪些种类 简单的jQuery插件实例 2025-04-22
-