3 Replies - 4387 Views - Last Post: 21 March 2007 - 05:40 AM Rate Topic: -----

#1 lavender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-March 07

What is the meaning of "lacks of cast" in Error message when

Posted 21 March 2007 - 01:31 AM

When I compile my code, it show :
WARNING : passing `int' to argument 1 of `deleteQueue(itemType *, queue *)' lacks a cast
What is the meaning for this warning?
Where I should coorect in my code?

void Print(queue *q)
{
int j;
if ((q->tail-q->head) >=5) 
{ 
for(j = 0;j < 5;j++)
{
printf("\nDocument %d  printing now",q->items[q->head]);
deleteQueue(q->items[q->head],q);
}
}
return;
}


void deleteQueue(itemType *nItem,queue *q)
{
printf(" Inside deleteQueue -> head : %d\n ", q->head);
q->head = (q->head + 1);
return;
}


This post has been edited by lavender: 21 March 2007 - 01:33 AM


Is This A Good Question/Topic? 0
  • +

Replies To: What is the meaning of "lacks of cast" in Error message when

#2 horace  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 291
  • View blog
  • Posts: 1,900
  • Joined: 25-October 06

Re: What is the meaning of "lacks of cast" in Error message when

Posted 21 March 2007 - 02:06 AM

what is the type of q->head?
Was This Post Helpful? 0
  • +
  • -

#3 lavender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-March 07

Re: What is the meaning of "lacks of cast" in Error message when

Posted 21 March 2007 - 05:38 AM

View Posthorace, on 21 Mar, 2007 - 02:06 AM, said:

what is the type of q->head?



int head;
Was This Post Helpful? 0
  • +
  • -

#4 illello  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 09-September 06

Re: What is the meaning of "lacks of cast" in Error message when

Posted 21 March 2007 - 05:40 AM

The prototype of funciont deleteQueue want a pointer to itemType as parameter 1:

void deleteQueue(itemType *nItem,queue *q)



So you have to pass it by address using "&":

deleteQueue(&q->items[q->head],q);


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1