Storing a word inside a Byte array
- From: artist <nospam@xxxxxxxx>
- Date: Thu, 07 Aug 2008 13:50:07 -0400
Hi all,
I have the following:
byte[] msgData = new byte[100];
ushort aaa = 0xFFFA;
Now I would like to store that variable aaa in the array
so at the end I would have something like:
msgData[0] = 0xFF;
msgData[1] = 0xFA;
Since I cannot do something like this:
m_buffer[0] = aaa;
Is there an easy and fast way of doing that?
I know i can extract the first byte from aaa and put it in msgData[0]
and the same with the second byte, but I was wondering if there is something simpler than that.
I'm afraid this is a trivial question, but I haven't been able
to find the answer.
Thanks!
.
- Follow-Ups:
- Re: Storing a word inside a Byte array
- From: parez
- Re: Storing a word inside a Byte array
- Prev by Date: Re: Matching machines with components:Algorithm
- Next by Date: RE: Need to convert some VB6 code to C#
- Previous by thread: Get number from end of name
- Next by thread: Re: Storing a word inside a Byte array
- Index(es):
Relevant Pages
|