13lade619
is now a game developer :)
- Reaction score
- 399
I want to dequeue to tempnode, but it needs to be a pointer.
tempnode isnt getting the correct values..
Specifically, I need Q->front->info out of the Dequeue function into a pointer variable..
Code:
Node *tempnode;
while(!IsQueueEmpty(&nodeQueue)){
Dequeue(&nodeQueue, tempnode);
printf("%s\n",tempnode->info);
};
tempnode isnt getting the correct values..
Code:
struct node {
char info[100];
};
typedef struct node Node;
struct qnode {
Node *info;
struct qnode *link;
};
typedef struct qnode QueueNode;
struct queue {
QueueNode *front;
QueueNode *rear;
};
typedef struct queue Queue;
void Dequeue(Queue *Q, Node *n) {
QueueNode *alpha;
n = Q->front->info;
alpha = Q->front;
Q->front = Q->front->link;
free(alpha);
}
Specifically, I need Q->front->info out of the Dequeue function into a pointer variable..