Which order is the and && operator evaluated
For example the following code
if (float alpha = value1-value2 && alpha > 0.001)
//do something
threw an exception that alpha is being used without being initiated.
I thought the expression left of the && would always initiate the value of alpha first, but it seems I may be wrong
Any idea?
Thanks
This gets parsed as:
… because
&&has a higher “parsing precedence” than=— which is probably not what you want. Try: