“请求转换为非标量类型”这个小代码片段中的错误
这是我的代码片段,在尝试编译它时,它在“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
}
预先感谢,
斯里
Here is my code snippet, while trying to compile this its showing "conversion to non-scalar type requested" error at line "tid[i] = (pthread_t) -1" which is highlighted below. Please help me if anyone knows about this.
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
}
thanks in advance,
Sri
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
呃....我主要缺少 pthread_t 的包含,
否则,我很确定它与
tid
的(未显示)定义有关Erm.... I'm mainly missing the include for pthread_t
Otherwise, I'm pretty sure it is with the (not shown) definition of
tid