J
jp2msft
I've got a small array that is part of a class.
I know how to create the 8x8 array and fill the 8x8 array, but FxCop and
Microsoft's "Best Practices" frowns on declaring the array as "public".
So, how should one access array elements from outside of the class?
Obviously, 8x8=64 public properties for each array element is absurd.
Microsoft's DataTable has the Rows method that can be accessed as:
for (int i = 0; i < DataTable1.Rows.Count; i++)
Console.WriteLine("Row {0}: {1}", i, DataTable1.Rows[0].ToString());
My goal is to learn how to access arrays in my class similar to the
DataTable's array of values.
Thank you for your time,
Joe
I know how to create the 8x8 array and fill the 8x8 array, but FxCop and
Microsoft's "Best Practices" frowns on declaring the array as "public".
So, how should one access array elements from outside of the class?
Obviously, 8x8=64 public properties for each array element is absurd.
Microsoft's DataTable has the Rows method that can be accessed as:
for (int i = 0; i < DataTable1.Rows.Count; i++)
Console.WriteLine("Row {0}: {1}", i, DataTable1.Rows[0].ToString());
My goal is to learn how to access arrays in my class similar to the
DataTable's array of values.
Thank you for your time,
Joe