another related question is Segmentation error when using strcpy ()?
I have a structure:
struct thread_data{
char *incall[10];
int syscall arg_no;
int client_socket;
};
How to initialize a pointer to a structure of the type above, and also initialize a pointer to 10 lines (incall []) inside the structure.
I initialize the lines first, and then the structure.
Thank.
Editing: I assume that I used the wrong word and should have said “highlight”. In fact, I pass this structure as an argument to threads. The number of threads is not fixed, and the data structure sent as an argument must be unique for each thread and "thread safe", so it cannot be changed by other threads.