typedef struct _stats_pointer_t
{
char **fileNames;
stats_t stats;
} stats_pointer_t;
I need to fill 'fileNames'. Basically, I need to mimic this functionality:
char *fileNames[argc - 1];
fileNames[0] = argv[0];
... but using the struct stats_pointer. So I need to declare the struct, then probably allocate memory for the array but I'm not sure if that's necessary. Finally, I need to fill the array.
Revision: I need to declare the new struct as stats_pointer_t **sp;
because I need to pass this struct as an argument to a thread later. So I tried allocating memory for the struct and then for fileNames, but Eclipse's debugger tells me that it can't access fileNames when its being allocated. So how can I do this with stats_pointer_t **sp;
instead of stats_pointer_t sp;
Thanks, Hristo