Convert vb code to c# / bool

Hhe code create inside a class . How do I convert this to c# code ?

vb code :

Public Shared HBitEnable(16) As Boolean

my code in c#

public static bool HBitEnable(16)

error

"Type expected"

Jon Skeet
people
quotationmark

I believe your VB code is actually declaring an array and initializing it - not declaring a method. (It's not a local variable - it's a public static field.) So the equivalent in C# would be:

public static bool[] HBitEnable = new bool[17];

Note the use of 17 rather than 16, as VB array initialization states the maximum valid index, not the length of the array.

I would strongly advise against the use of public static fields anyway, mind you.

people

See more on this question at Stackoverflow