Why in the code below*, and parentheses? | C++?

Hello! Threw the code in the game throws the object. I'm trying to understand how it works, but did not understand only one line: *(float*)0x009386DC += 10.0 f;.
I did not understand, *(float*) - what is it??
0x009386DC address.
But that means blender *(float*)??
June 3rd 19 at 19:06
1 answer
June 3rd 19 at 19:08
Solution
Considering the value at the address 0x009386DC as floating point single precision add to it 10.
And that gives *(float*)? - willy_Satterfield commented on June 3rd 19 at 19:11
,
0x009386DC - just a number in hexadecimal format.

(float*)0x009386DC - this number is the address where is a real number in single precision.

*(float*)0x009386DC - the very real number single-precision, located at the specified address. - Kenyatta commented on June 3rd 19 at 19:14
I.e. the variable definition float at 0x009386DC? - willy_Satterfield commented on June 3rd 19 at 19:17
No , technically the variable is not there. There are just a number written at the specified address. (float *) says to treat that address, and the first asterisk is that you have to work with the address and that this address is recorded. - Kenyatta commented on June 3rd 19 at 19:20

And that gives *(float*)?

This type conversion with dereferencing. Any raw address is treated as void*, and to begin to work with it, it should, at least, to address to a variable of a specific type.
And it's not a variable Declaration is just a type cast.

Design (float*) from void* will do a float*, and the star on the left is of a pointer dereference, resulting in a float&. After this easy operation with memory address can be used as a variable of type float.

It has now become clearer? - Benjamin_McClure commented on June 3rd 19 at 19:23

Find more questions by tags C++