动态内存函数:malloc(n字节),calloc(),realloc()

一、申请内存函数:malloc(n字节)函数 通常用法:malloc(n*sizeof(int))spa #include<stdib.h>//申请内存与释放内存 #include<vld.h>//检测内存泄漏 #include《assert.h>//断言 int main() { int *p=(int*)malloc(10*sizeof(int));//申请10个格子的内存,共40字节 as
相关文章
相关标签/搜索