我有一个全局结构:
struct thread_data{
char *incall[10];
int syscall arg_no;
int client_socket;
};
并在 main()
char buffer[256];
char *incall[10];
struct thread_data arg_to_thread;
strcpy(incall[0],buffer); /*works fine*/
strcpy(arg_to_thread.incall[0],buffer); /*causes segmentation fault*/
为什么会发生这种情况,请提出出路。
谢谢