传递指针参数(函数内部给指针赋值)示例
程序员文章站
2022-09-17 18:19:23
~~~~ include unsigned char ptr = NULL; unsigned char num = 3; static void fun(unsigned char mem) { mem = # } int main() { fun(&ptr); printf("%d \n ......
#include <stdio.h> unsigned char *ptr = NULL; unsigned char num = 3; static void fun(unsigned char **mem) { *mem = # } int main() { fun(&ptr); printf("%d \n", *ptr); return 0; }
上一篇: django之路:第一天