動態內存函數: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
相關文章
相關標籤/搜索