Home > Back-end >  O bosses to solve it
O bosses to solve it

Time:06-07

Create a circular queue

The Queue * queue_create (void)
{
The Queue * q=malloc (sizeof (Queue));
If (NULL==q)
{
return NULL;
}
The else
{
Q - & gt; The front=0;
Q - & gt; Rear=0;
The return of q;
}
}
Molloc has a problem, of type void * values should not be used to initialize the Queue * type of entity

CodePudding user response:

Not molloc of malloc, and the need to introduce stdlib. H header file ~

In addition, the proposal put up a complete code and error message ~

CodePudding user response:

Queue * q=(Queue *) malloc (sizeof (Queue));

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related