Beginner Question

B

Brent

Hi everyone. I tried to convert this line of code last night from vb.net to
C# and i had problems. Could anyone tell me you how you would convert this
line of code to C#:


Private Vector() As Byte = {&H12, &H44, &H16, &HEE, &H88, &H15, &HDD,
&H41}Of course the problem is with defining the hex values. I have no idea
how to do that in C# and when i searched on google how to do it i didn't
find any good examples.thanks
 
J

Jon Skeet [C# MVP]

Brent said:
Hi everyone. I tried to convert this line of code last night from vb.net to
C# and i had problems. Could anyone tell me you how you would convert this
line of code to C#:


Private Vector() As Byte = {&H12, &H44, &H16, &HEE, &H88, &H15, &HDD,
&H41}Of course the problem is with defining the hex values. I have no idea
how to do that in C# and when i searched on google how to do it i didn't
find any good examples.thanks

byte[] Vector = new byte[] {0x12, 0x44, 0x16, 0xee, 0x88, 0x15, 0xdd,
0x41};
 
B

Brent

thanks jon

--


----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com

Jon Skeet said:
Brent said:
Hi everyone. I tried to convert this line of code last night from vb.net
to
C# and i had problems. Could anyone tell me you how you would convert
this
line of code to C#:


Private Vector() As Byte = {&H12, &H44, &H16, &HEE, &H88, &H15, &HDD,
&H41}Of course the problem is with defining the hex values. I have no
idea
how to do that in C# and when i searched on google how to do it i didn't
find any good examples.thanks

byte[] Vector = new byte[] {0x12, 0x44, 0x16, 0xee, 0x88, 0x15, 0xdd,
0x41};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top