I am confused. I can not use this on a float? Must it be a integer? I try to define that as a point but I guess I can not convert float to float *
//global definition
float g_posX = 0.0f;
&g_posX -= 3.03f;
You probably simply want to do this:
float g_posX = 0.0f;
g_posX -= 3.03f;
What your code tries to do is take the address of g_posX and subtract 3.03f from the address. That does not work, for two reasons:
If you want to subtract from the float then just name the variable and don't take its address:
g_posX -= 3.03f;
Otherwise, &g_posX is an rvalue that you can't assign to it anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With