I have a file queue.c that defines a Queue in C. How would I make 3 separate queues independent of each other? I'm not very experienced with C, and I keep thinking of it in an OO view, and I know that I can't do that.
#include <stdio.h>
#include <stdlib.h>
struct Node
{
char data;
struct Node *next;
} *Head, *Tail;
void addCharacter(char c)
{
struct Node *temp1, *temp2;
temp1 = (struct Node *)malloc(sizeof(struct Node));
temp1->data = c;
temp2 = Tail;
if(Head == NULL)
{
Head = temp1;
Head->next = NULL;
Tail = Head;
}
else
{
Tail = temp1;
temp1->next = NULL;
temp2->next = temp1;
}
}
void deleteCharacter()
{
struct Node *temp1 = Head;
Head = temp1->next;
free(temp1);
}
int replaceCharacter(char c)
{
Head->data = c;
}
int main() {}
That's my Queue, and all I have for another C file is essentially:
#include "queue.h"
I don't know where to go from there...