'+ =': pointer to the left; needs the integral value on the right
5 answers
You probably just want to do this:
float g_posX = 0.0f;
g_posX -= 3.03f;
What your code is trying to do is take the address g_posX
and subtract it 3.03f
from the address. This doesn't work for two reasons:
- The address is not an lvalue: it cannot be assigned. Assigning an address would be meaningless. What would it do if you move the variable in memory?
- Pointer arithmetic can only be done using integers. There are no fractional addresses.
+18
a source to share