现在,价格被从一个字符串转换成了一个浮点类型。
At this point, the price is converted from a string into a float.
在 64 位系统上,整型被转换成 64 位的整型值,单精度的浮点类型被转换成双精度的浮点类型。
On a 64-bit system, integral types are converted to 64-bit integral types, and single precision floating point types are promoted to double precision.
解决方案是将浮点变量的地址强制转换成一个指向整型类型的指针,如下所示。
The solution is to cast the address of the floating point variable to a pointer to an int, which is then de-referenced as shown below.
应用推荐