#include<stdio.h>void f(int *q){*q=200;}main(){int *p=(int *)malloc(sizeof(int));*p=10;printf("%d\n",*p);f(p);printf("%d\n",*p);}
动态数组应用:(记得导入#include<malloc.h>)
#include<stdio.h>
#include<malloc.h>int main(){int *pArr;int len,i;printf("请输入数组的长度:\n");scanf("%d",&len);pArr=(int *)malloc(4*len);for(i=0;i<len;i++){printf("请输入第%d个数:\n",i+1);scanf("%d",&pArr[i]);}printf("它的内容是:");for(i=0;i<len;i++){for(i=0;i<len;i++){printf("%d\t",pArr[i]);}}}