C编译中的队列实现错误 [英] queue implementation in C compilation error

查看:69
本文介绍了C编译中的队列实现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用链表的队列程序.当我编译它时,它具有以下错误:
expected ‘)’ before ‘*’ token >>in error_line

I have a program with queues using linked lists. When i compile it, it has the following error:
expected ‘)’ before ‘*’ token >>in error_line

///USEFUL PART OF THE PROGRAM
//queue struct
typedef struct{
    int embros,piso,adeia;
    int pinakas[PLITHOS];
}Q;
int main(){ Q oura_apo; //define a new queue
dimiourgia(&oura_apo);//create the new queue
return 0; } //this function creates a new empty list
void dimiourgia(Q *oura){  //this is error_line
    oura->embros=0;
    oura->piso=0;
}



如果您能告诉我错误的含义是什么?


Or
If you could just tell me what does the error mean?

推荐答案

一旦我发明了您认为超出此范围的东西,它就会为我编译好:你有以上这个吗?编译器在抱怨哪一行?

如果双击该错误消息,则应将您带到错误行.

一个想法:

必须获得在main上面定义的dimiourgia原型吗?
如果是这样,它是否与您在此处给出的定义相符?
如果不是,则在Q的定义和main的定义之间放置一个:
It compiles OK for me once I''d invented the stuff I assume you have above this: What do you have above this? What line is the compiler complaining about?

The error message should take you to the error line if double clicked.

A thought:

Have to got a prototype of dimiourgia defined above main?
If so, does it match the definition you have given here?
If not, put one between the definition of Q and the definition of main:
void dimiourgia(Q *oura);



这样可以解决您的问题.



That may cure your problem.


这篇关于C编译中的队列实现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆