What is the C# equivalent of this code?
-
string lookFor; // used to store the restaurant name we are looking for BOOL bFound; //Take the 1st element in the linked list while ( ! ListEmpty(l) ) { lookFor = l->elem->restaurant; // Storing r. name for the current list element... bFound = FALSE; tmp = q->front; // Get the first element in the queue while( ( ! QueueEmpty(q) ) && ( ! bFound ) ) { cout << tmp->item << tmp->cuisine << tmp->mode << endl; if ( ! strcmp(tmp->restaurant, lookFor) ) { bFound = TRUE; // found what we were looking for! } else tmp = tmp->next; // still not found, search further in the queue } if ( bFound ) // It was found { //Do what you please with the info in *tmp* //it is the coresponding to the current list item }
-
string lookFor; // used to store the restaurant name we are looking for BOOL bFound; //Take the 1st element in the linked list while ( ! ListEmpty(l) ) { lookFor = l->elem->restaurant; // Storing r. name for the current list element... bFound = FALSE; tmp = q->front; // Get the first element in the queue while( ( ! QueueEmpty(q) ) && ( ! bFound ) ) { cout << tmp->item << tmp->cuisine << tmp->mode << endl; if ( ! strcmp(tmp->restaurant, lookFor) ) { bFound = TRUE; // found what we were looking for! } else tmp = tmp->next; // still not found, search further in the queue } if ( bFound ) // It was found { //Do what you please with the info in *tmp* //it is the coresponding to the current list item }
You keep asking the same thing, and at least 2 of us have asked for further clarification a couple of threads down from your original posts. I suggest that you re-read these comments carefully, and rephrase your question to address the points people have raised.