摘要: 案例: 功能:可以根据用户输入的命令完成相应的功能; 例如: 用户输入 hello 完成输出 hello的功能。 用户输入 hi 完成输出 hi 的功能。一般的写法可能会写两个函数来实现 输出 hello 和 hi 的功能,然后在根据用户输入的字符串与 hello 和 hi 比较,然后执行相应的函数。代码如下: 1 //回调函数的用处 2 #include 3 #include 4 5 void hello(void); 6 int my_strcmp(char* des, char* src); 7 void hi(void); 8 9 int main(void){... 阅读全文
posted @ 2014-03-24 23:31 net小伙 阅读(3356) 评论(1) 推荐(0) 编辑