我有一个共享的结构,并且在其内部的请求结构:Ç嵌套结构指针问题
struct shared_data {
pthread_mutex_t th_mutex_queue;
struct request_queue {
int min;
int max;
char d_name[DIR_SIZE];
pid_t pid;
int t_index;
} request_queue[BUFSIZE];
int count;
int data_buffer_allocation[BUFSIZE];
int data_buffers[BUFSIZE][100];
};
然后,我制备的请求;
struct shared_data *sdata_ptr;
...
...
sdata_ptr->request_queue[index].pid = pid;
strcpy(sdata_ptr->request_queue[index].d_name, dir_path_name);
sdata_ptr->request_queue[index].min = min;
sdata_ptr->request_queue[index].max = max;
,编译器警告我说,我做的strcpy函数不兼容的隐式声明。我想这是指针的问题,但不是我上面写的应该是真的?
Did you include? –
2010-04-03 11:28:53
不,我现在做了,还没有测试过,但我想现在就可以运行了。 – Halo 2010-04-03 14:19:35