- 博客(2)
- 收藏
- 关注
原创 malloc第二个小例子
#include "stdio.h" #include "malloc.h" void fun(int *a) { *a=100; } int main() { int * a = (int *)malloc(4); *a=50; printf("%d\n",*a); fun(a); printf("%d\n",*a); return 0; } malloc
2017-07-31 12:22:23
475
原创 用malloc函数实现一维数组的模拟
用malloc函数实现一维数组的模拟 #include "stdio.h" #include "malloc.h" //用malloc函数实现一维数组的模拟 void main() { int len;//一维数组的长度 int i;//循环 int val;//存储值 int * p; printf("请输入数组的长度:"); scanf("%d",&l
2017-07-31 12:15:17
1765
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人