这是我的代码片段,在尝试编译它时,它在“tid[i] = (pthread_t) -1”行显示“请求转换为非标量类型”错误,该错误突出显示以下。如果有人知道这件事,请帮助我。
main(void)
{
unsigned int i, repeat;
unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]);
void *results[MAX_ARGC];
int ret;
xmlInitParser();
for (repeat = 0;repeat < 500;repeat++) {
xmlLoadCatalog(catalog);
for (i = 0; i < num_threads; i++) {
results[i] = NULL;
**tid[i] = (pthread_t) -1;** //getting error at this point
}
提前致谢,
斯里兰卡
最佳答案
呃....我主要缺少 pthread_t 的包含
#inlcude <pthread.h>
否则,我很确定它与 tid
的定义(未显示)有关
关于c - "conversion to non-scalar type requested"这个小代码片段中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6014382/