What's wrong in my function 'front'? I want to pass the pointer to an specific line in my array to read/edit it.
struct queue
{
char itens[LN][CL];
int front,rear;
};
char *front(struct queue * pq)
{
return pq->itens[pq->front+1][0];
}
You're currently returning a single char
, not a pointer to a row. Take off the [0]
:
char *front(struct queue *pq)
{
return pq->itens[pq->front+1];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With