I have a struct that has an array of strings (char **args). I need to be able to copy an array of strings (char *input[32]) into that element of the struct. For example:
Thing s;
s.args = input; //assuming input already has some strings in it
When I try to do that, the next time s.args = input is called, it completely overwrites the old input. How can I achieve this functionality in the appropriate manner?
EDIT
This is what the struct looks like.
typedef struct{
char **args;
} Thing;
Then in my function, I have declared:
char *args[512];
.....
args[count] = string //string is a char *
Then finally, I want to do:
s.args = input.