How do I do a get/post for an array in c#?
In C#, you get and set variables like this:
public int ID { get; set; }
How would one get and set an array in C#?
This will not work:
public uint [5] BIG_Hash {get; set;}
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 25, 2012, 6:23 PM
public uint[] BIG_Hash {get; set;}
If you want to initialize the property to an array with 5 elements, then you could set this in the constructor:
class SomeClass
{
public uint[] BIG_Hash {get; set;}
public SomeClass()
{
BIG_Hash = new uint[5];
}
// ...
}