I am not quite clear on how to allocate memory to a struct pointer that contains a dynamic array field. for example, I have the following struct:
typedef struct log_file {
char *name;
int updatesize;
int numupdates;
int *users; /* dynamic array of integers */
} log_data;
When I created a pointer of log_data
using: log_data *log_ptr = malloc(sizeof(log_data));
How do I allocate enough memory for the dynamic array users
in the struct?