成哥C笔记-动态分配内存

来源:互联网 发布:高圆圆长相知乎 编辑:程序博客网 时间:2024/05/17 07:28
#include<stdio.h>#include<windows.h>void main(){    int x=0,i;    scanf_s("%d",&x);    int *p = (int *) malloc(x*sizeof(int));    for (i=0;i<x;i++)    {        p[i]=i+1;        printf("\n%d,%x",p[i],&p[i]);    }    getchar();}

0 0
原创粉丝点击