📜  malloc in - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:42.840000             🧑  作者: Mango

代码示例6
// Let's allocate enough space on the heap for an array storing 4 ints

intArray = (int *) malloc(4 * sizeof(int)); // A pointer to an array of ints

intArray[0] = 10;
intArray[1] = 20;
intArray[2] = 25;
intArray[3] = 35;