nayef harb
nayef harb

Reputation: 753

Compilation Error- Array of byte initialization

I am working on a VB project that needs to be transformed to c#. I came across the below code which do is doesn't seem to be valid with c# the compiler isn't recognizing &H21,&H43....

Can some one explain to me what do these codes mean and what is there equivalent in c#

Dim rgbIV As Byte() = New Byte() {&H21, &H43, &H56, &H87, &H10,&HFD,&HEA}

Upvotes: 0

Views: 95

Answers (1)

rory.ap
rory.ap

Reputation: 35338

Those are hexadecimal literal values. Here's what you want to do in C#:

var rgbIV = new Byte[] {0x21, 0x43, 0x56, 0x87, 0x10, 0xFD, 0xEA};

Upvotes: 1

Related Questions