我将如何去存储结构和int整数?在一个数组中存储一个结构和整数
/*a struct to keep block information*/
struct header{
int freeSpace;
struct header *nextHead;
struct header *prevHead;
};
int myinit(int *array, int size){
array[0] = size;
/*initial block*/
struct header root;
root.freeSpace = size - (sizeof(struct header));
array[1] = root; /*write the intial block to the array*/
}
阅读你所说的我想创建一个动态列表,而不是使用数组,任何建议我应该从我已经发布的地方去? – Alex 2010-11-19 11:29:13
ps:我正在重写malloc,所以我需要存储在数组[0]中的大小 – Alex 2010-11-19 11:31:02