#include <stdio.h> void test(void (*ps)( char *)) { printf("hello\n"); ps("你好吗"); } void print( char * str) { printf("%s\n",str); } int main() { test(print); return 0; }
回调函数:
最新推荐文章于 2024-08-03 21:15:16 发布
#include <stdio.h> void test(void (*ps)( char *)) { printf("hello\n"); ps("你好吗"); } void print( char * str) { printf("%s\n",str); } int main() { test(print); return 0; }