Click here to Skip to main content
15,566,522 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a program with queues using linked lists. When i compile it, it has the following error:
expected ‘)’ before ‘*’ token >>in error_line
MIDL
///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?
Posted
Updated 1-Mar-11 7:45am
v2
Comments
Sergey Alexandrovich Kryukov 1-Mar-11 13:01pm    
You did not show definition of "dimiourgia" and "PLITHOS" (OK, this one is integer constant), do you want to do some guesswork for you?
--SA
OriginalGriff 1-Mar-11 13:50pm    
Yes he does:
void dimiourgia(Q *oura){ //this is error_line
oura->embros=0;
oura->piso=0;
}
But I think he is missing the prototype...
Sergey Alexandrovich Kryukov 1-Mar-11 14:43pm    
Opps! I see, thank you (was reading from top).
--SA
OriginalGriff 1-Mar-11 15:04pm    
They never make it easy, do they? :laugh:
Sergey Alexandrovich Kryukov 1-Mar-11 15:26pm    
Not supposed to be easy :-)
--SA

1 solution

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:
C++
void dimiourgia(Q *oura);


That may cure your problem.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Mar-11 14:44pm    
Sure, a 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900