memory allocation
1192 ワード
1 mallocとfreeはC++/C言語の標準ライブラリ関数であり、new/deleteはC++の演算子である.
2,malloc,ヘッダファイル
3,
2,malloc,ヘッダファイル
3,
nt* p_scalar =new int(5);//Does not create 5 elements, but initializes to 5
int* p_array =new int[5];//Creates 5 elements
delete[] p_array;