vb如何byte数组转成integer
有一个4字符的byte数组byte(){122,218,152,240}
有什么函数能转成int类型的?转成int后是10017402
java中可以这么做,vb里有类似的函数吗?或该怎么实现?
[解决办法]
Dim a(3) As Byte
Dim b As Long
a(0) = 122
a(1) = 218
a(2) = 152
a(3) = 0
b = CLng(a(0)) + CLng(a(1)) * 256& + CLng(a(2) * 65536) + CLng(a(3)) * 16777216
Debug.Print b '10017402
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Dim a(3) As Byte
Dim b As Long
a(0) = 122
a(1) = 218
a(2) = 152
a(3) = 0
Call CopyMemory(b, a(0), 4)
Debug.Print b