Advertisement

03.03.2004 at 06:29PM PST, ID: 20906412
[x]
Attachment Details

create byte array in vb.net

Asked by wsurferdude in .NET

Tags: array, byte, create

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

 Start Free Trial
[+][-]03.03.2004 at 06:48PM PST, ID: 10510711

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.03.2004 at 07:51PM PST, ID: 10510933

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: array, byte, create
Sign Up Now!
Solution Provided By: KarunSK
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.04.2004 at 06:52AM PST, ID: 10514321

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2004 at 09:06AM PST, ID: 10515680

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32