John Cournoyer
asked on
create byte array in vb.net
newbie question,
how do i create a char array in vb.net. i'm translating the following code to vb and am able to create an unsigned int array in vb, but not a char array with hex bytes as shown in the last line of the following example.
// c code
unsigned int ar0[11] = {5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4}
unsigned char ar1[16] = {0x33,0x73,0x3b,0x26,0x63, 0x23,0x6b, 0x76,0x3e, 0x7e,0x36, 0x2b,0x6e, 0x2e,0x66, 0x7b}
'vb code
Dim ar0 As UInt16() = {5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4} // works
Dim ar1 As Char() = {0x33, 0x73, 0x3b, 0x26, 0x63, 0x23, 0x6b, 0x76, 0x3e, 0x7e, 0x36, 0x2b, 0x6e, 0x2e, 0x66, 0x7b} // no work
how do i create a char array in vb.net. i'm translating the following code to vb and am able to create an unsigned int array in vb, but not a char array with hex bytes as shown in the last line of the following example.
// c code
unsigned int ar0[11] = {5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4}
unsigned char ar1[16] = {0x33,0x73,0x3b,0x26,0x63,
'vb code
Dim ar0 As UInt16() = {5, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4} // works
Dim ar1 As Char() = {0x33, 0x73, 0x3b, 0x26, 0x63, 0x23, 0x6b, 0x76, 0x3e, 0x7e, 0x36, 0x2b, 0x6e, 0x2e, 0x66, 0x7b} // no work
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dim ar1 As Byte() = {&H33, &H73, &H3B, &H26, &H63, &H23, &H6B, &H76, &H3E, &H7E, &H36, &_
&HD3, &H93, &HDB, &H6, &H43, &H3, &H4B, &H96, &HDE, &H9E, &HD6, &_
&HB, &H4E, &HE, &H46, &H9B, &H57, &H17, &H5F, &H82, &HC7, &H87, &HCF}