1
我想一個Double
變量轉換成8個字節數組,這就是我跟到目前爲止:雙轉換成8個字節數組
Dim b(0 To 7) As Byte
Dim i As Integer
dim d as double
d = 1 ' for simplicity, I sit the variable "d" to 1
For i = 0 To 7
Call CopyMemory(b(i), ByVal VarPtr(d) + i, 1)
Next i
' b => [0, 0, 0, 0, 0, 0, 240, 63]
我做錯了嗎?
的一個例子,[如何再轉換回(http://stackoverflow.com/q/15782705/588306)。 – Deanna