函数回调(有参数)
2015-09-25 16:30
190 查看
#include<iostream>
/*有参函数的回调*/
void print(char* s)
{
std::cout << s << std::endl;
}
void callPrint(void(*callfuct)(char*),char* s)
{
callfuct(s);
}
int main_huidiao(int argc, char **argv)
{
callPrint(print,"hello\n");
return 0;
}
/*回调函数即用函数指针指向被调函数,实现函数的回调*/
/*有参函数的回调*/
void print(char* s)
{
std::cout << s << std::endl;
}
void callPrint(void(*callfuct)(char*),char* s)
{
callfuct(s);
}
int main_huidiao(int argc, char **argv)
{
callPrint(print,"hello\n");
return 0;
}
/*回调函数即用函数指针指向被调函数,实现函数的回调*/
相关文章推荐
- Javaweb 学习笔记之文件上传和下载-01
- 机房收费系统项目开发总结报告
- 谈谈SQL 语句的优化技术 (2)
- Perfect Cubes - 1543
- mac 下安装macVim
- Swift - 导航条(UINavigationBar)的使用
- Swift - 环形进度条(UIActivityIndicatorView)的用法
- 理解 OpenStack + Ceph (3):Ceph RBD 接口和工具 [Ceph RBD API and Tools]
- python3 入门 (三) 函数与lambda表达式、闭包
- Log4Net使用指南之用log4net记录日志到数据库(含有自定义属性)------附Demo例子源代码
- string.format大全
- 抛硬币的案例源码实例
- solr5.2和tomcat整合
- 黑马程序员——C语言基础---数据类型
- Centos7 使用总结
- Java线程面试题 Top 50
- scanf()函数
- 函数回调(无参数)
- T-SQL语句优化的常见技巧
- 谈谈SQL 语句的优化技术 (1)