I think I might know the answer to this, but I wanted to make sure I fully understand.
I've written a Queue structure in C, as well as operations for use on a Queue struct. I would like to pop the queue, retrieving one element. This element would be the first parameter into my function. I would like to pop the queue again, retrieving the second element. This second element would be my second parameter.
For example:
e1 = pop(Q);
e2 = pop(Q);
myfunction(e1, e2);
I would like to do this is in a slicker way that doesn't require me to make two throwaway variables.
My assumption would be the following:
myfunction(pop(Q), pop(Q))
But I'm not 100% sure if this is correct.
Is this correct? Are there slicker ways of accomplishing this?