How do I create a queue that can insert and delete more than one data value with the data value being string? Please and thanks
Here's my program it's still not working the way I want it to #include<stdio.h> #include<string.h> #include<stdlib.h> # define max 50 typedef struct patient_data{ char fname[10],lname[10],address[10],condition[10],symptoms[12]; int patient_num; }; queue[max]; int insq(char queue[max][80], int *rear, char p_data[80]) { if(*rear == max -1) return(-1); else { *rear = *rear + 1; strcpy(queue[*rear], p_data); return(1); } } int delq(char queue[max][80], int *front, int *rear, char p_data[80]) { int i; if ((front==-1) && (rear==-1)) { printf("\nQueue is empty no elements to delete"); return; } for (i = 0; i <= rear; i++) { if (p_data == queue[i]) { for (; i < rear; i++) { queue[i] = queue[i + 1]; } queue[i] = -99; rear--; if (rear == -1) front = -1; return; } } printf("\n%d not found in queue to delete", p_data); /*if(*front == *rear) return(-1); else { (*front)++; strcpy(p_data, queue[*front]); return(1); }