I want to convert a Double
variable into an 8-bytes array, this is what I've come with so far:
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]
What I'm doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…