K
Kay
There is a queue containing three different items - name, number,
character. Then, it has a linked list containing the name that is as
same as the queue. If I want to display the the number and character by
comparing the name with the queue and the list, is it possible to show
the number and character from the queue ? If yes, how to do that ?
The funtion has two arguement - *q and *input form the linked list. This
function can't do what I have mention as above even I have a if loop.
How to do what I have mentioned.
void DisplayCuisineByRestaurant( Queue * q, char * input){
QueueNode * tmp;
char * item, * cuisine, *mode;
//checking the queue until empty
while(!QueueEmpty(q)){
tmp = q->front;
item = tmp->item;
cuisine = tmp->cuisine;
mode = tmp->mode;
----> if( strcmp( input, cuisine ) == 0 ){
----> cout << item << mode << endl;
----> }
q->front = tmp->next;
}
}
character. Then, it has a linked list containing the name that is as
same as the queue. If I want to display the the number and character by
comparing the name with the queue and the list, is it possible to show
the number and character from the queue ? If yes, how to do that ?
The funtion has two arguement - *q and *input form the linked list. This
function can't do what I have mention as above even I have a if loop.
How to do what I have mentioned.
void DisplayCuisineByRestaurant( Queue * q, char * input){
QueueNode * tmp;
char * item, * cuisine, *mode;
//checking the queue until empty
while(!QueueEmpty(q)){
tmp = q->front;
item = tmp->item;
cuisine = tmp->cuisine;
mode = tmp->mode;
----> if( strcmp( input, cuisine ) == 0 ){
----> cout << item << mode << endl;
----> }
q->front = tmp->next;
}
}