Tag: struct

malloc of an array within a struct

问题内容: I have the following code declaring a struct: typedef struct variable_array{ int length; BUCKET * array; }VARIABLE_ARRAY; typedef struct bucket{ int Hash; int KeyValue; char Data[MAX_INPUT]; char Key[MAX_INPUT]; }BUCKET; I am then declaring the array with the following code: VARIABLE_ARRAY varArray[Width]; Then to create the array withing the VARIABLE_ARRAY i am using this: varArray[hash].array