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;}
Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!
public int ID { get; set; }
public uint [5] BIG_Hash {get; set;}
public uint[] BIG_Hash { get; set; }
BIG_Hash = new uint[5];
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;}
private uint[] _bigHash = new uint[5]; public uint[] bigHash { get { return _bigHash; } set { _bigHash = value; } }
Edited by AceInfinity, 07 October 2012 - 06:54 PM.
Sorry to drag this back from the dead, but I feel the need to set the record straight. The "get; set;" syntax is valid, they're called auto-implemented properties in C#:
http://msdn.microsof...y/bb384054.aspx
The problem with the OP's code is that you can't set the size of the array with the auto-implemented property syntax.
Cheers!
Ax
static int[5] GetArray() { }
Edited by AceInfinity, 02 July 2013 - 11:29 PM.
That's not how you define a property in C#.
0 members, 0 guests, 0 anonymous users
Community Forum Software by IP.Board
Licensed to: Geeks to Go, Inc.