摘要: 使用malloc进行动态分配 /* 动态分配内存 */ #include <stdio> #include <stdlib> int main(){ int *p_val = (int *) malloc(5 * sizeof(int)) if (!p_val) { return -1; } fre 阅读全文
posted @ 2020-03-25 22:01 c语言我的最爱 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 使用typedef int (*p_func) (int, int) 来定义函数指针,使用p_func p_add = NULL; 进行函数的定义和声明 /* 函数指针演示 */ #include <stdio.h> typedef int (*pfunc_t) (int, int); //函数指针 阅读全文
posted @ 2020-03-25 20:59 c语言我的最爱 阅读(216) 评论(0) 推荐(0) 编辑