
c&c++
挨踢牛
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c调用有参回调函数
void test_call_back(int arg) { printf("the call back function arg:%d\n", arg); } void test(void (*f)(int a)) { (*f)(5); } int main() { test(test_call_back); return; } ========原创 2014-04-04 11:40:01 · 558 阅读 · 0 评论 -
子函数不能传递动态内存的原因解析
举例: voidGetMemory(char *p) { p = (char *)malloc(100); } void Test(void) { char *str = NULL; GetMemory(str); strcpy(str, "hello world"); printf(str); }转载 2014-04-04 16:55:08 · 1378 阅读 · 0 评论