Q:

Removing the first element from a queue C++

I'm trying to remove the first element of the Queue but, this does not seem to work. Here is my code:
struct List {
    //string name;
    double price;
    List* next; 
};
List* head = NULL; List* tail = NULL;
struct queue
{
    List* head, * tail;
};
void printAll()
{
    cout << "Data in the queue:\t";
    for (List* temp = head; temp != NULL; temp = temp->next)
    {
        cout << temp->price << "\t";

        if (temp->next == NULL)
        {
            delete temp; // here I don’t know how to write it down
        }
}

A:

Remember that using existing containers is much easier to get results. In this case, removing the oldest entry in a std::queue would be if (! myQueue.empty()) myQueue.pop(); with added safety that there is actually to delete.
However, to learn programming, it makes sense to make your own containers and there are even circumstances where own containers perform better, so about your question: when changing anything in a linked list, the pointers have to be updated to still have a consistent linked list, so to remove an entry, the pointer to the entry has to point to the next entry and then the selected entry can be deleted. In case of the first entry, that's the one that head is pointing to, so just point to that with a temporary pointer, let the head pointer point to what the first entry is pointing to and then you can safely delete the first entry via the temporary pointer.
If in your example, you actually fill the queue at the head side and remove at the tail side, you would always need to iterate to find the last but one element to set its pointer to null and let tail point to it. This is not a good idea on a singly linked list. Fill at the tail and remove at the head side.
Also, make sure to not change data in "print"-functions. Make functions predictable by not doing more than is announced by the name. A better name for the current function could be "finishExample" or "processQueue" which can do an output and cleanup.
If you feel like cheating, or need some inspiration, this gives an example implementation: https://www.geeksforgeeks.org/queue-linked-list-implementation/ where enQueue() fills and deQueue() removes. (I just googled an example, so I can't say how good it actually is.)

