【发布时间】:2010-04-03 11:26:37
【问题描述】:
我有一个共享结构,里面有一个请求结构:
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 函数中做了不兼容的隐式声明。我想这是指针的问题,但我上面写的不应该是真的吗?
【问题讨论】:
-
不,我现在做了,还没有测试,但我想它现在可以工作了。