What happens first

Greetings and Salutations! I have this function call:
temp = grid->getHex(seekerX--, seekerY++);
and the six other variations that search a grid of hexes for possible moves however any conditions in which it pushes onto a vector are always itself.
What happens first the call to getHex (with the original values) or the modification of seeker?
Thanks in advance
Function arguments are always fully evaluated before they are passed to a function. You use the postfix decrement and increment operators so the old values of seekerX and seekerY will be passed to the function.
Last edited on
Thanks for the speedy reply. Okay if I were to use getHex((seekerX--),(seeker++) ) be the same as using the prefix operator?
No. The postfix operators returns the value that the variables had before their values was changed. Parentheses don't change that value.
Last edited on
Topic archived. No new replies allowed.