求将1LONG数值转存到一BYTE数组的方法,不要用COPYMEMORY函数

求将一LONG数值转存到一BYTE数组的方法,不要用COPYMEMORY函数
求将一LONG数值转存到一BYTE数组的方法,不要用COPYMEMORY函数
------解决方案--------------------
这个你需要区分Bigendian和Littleendlian,两个字节顺序是相反的。
------解决方案--------------------
http://download.****.net/detail/veron_04/1681799
------解决方案--------------------


type DWORD
   A as byte
   B as byte
   C as byte
   D as byte
end type

type ULong
   value as long
end type

'取一个32位int型的四个字节
function getBytes(byval n as long) as byte()
   dim ul  as ULong
   dim dw as DWORD
   dim b(0 to 3) as byte

   ul.value=n
   lset dw=ul

  '大小端自己看着办
   b(3)=dw.A
   b(2)=dw.B
   b(1)=dw.C
   b(0)=dw.D

   getBytes=b
end function


------解决方案--------------------
引用:


type DWORD
   A as byte
   B as byte
   C as byte
   D as byte
end type

type ULong
   value as long
end type

'取一个32位int型的四个字节
function getBytes(byval n as long) as byte()
   dim ul  as ULong
   dim dw as DWORD
   dim b(0 to 3) as byte

   ul.value=n
   lset dw=ul

  '大小端自己看着办
   b(3)=dw.A
   b(2)=dw.B
   b(1)=dw.C
   b(0)=dw.D

   getBytes=b
end function



脑残,怎么不敢回我的贴了, 学会下android源码了?