Linux in c language to create dynamic arrays

Create a dynamic array in Linux, the idea is, the space created by the dynamic heap, to meet an array,

First of all we need to know the length of the size of the array to be created, then that is dynamically created by calloc function (here you can also here according to their personal preferences with malloc function) (in this function exists in stdlib.h)

The following code on directly: c attach a tag memory rough FIG.

 

 

 

Guess you like

Origin www.cnblogs.com/littleswan/p/12162604.html