Suggestions on best practive for array declare / subscript
using an enum - this is easy in Delphi / Object Pascal.
I want
private MyObjectClass [] myObjects;
myObjects = new MyObjectClass [DateTime.DayOfW eek];
myObjects [DayOfWeek.Monda y] = new MyObjectClass() ;
myObjects [DayOfWeek.Tuesd ay] = new MyObjectClass() ;
but C# says array subscript must be int type
How best to do this.
1) what is syntax for cardinality of DayOfWeek enum?
2) what is 1st and last of enumeration?
e.g.
for (DayOfWeek index=low(DayOf Week);
index <= high(DayOfWeek) ; index++)
{ . . . }
Gregg
using an enum - this is easy in Delphi / Object Pascal.
I want
private MyObjectClass [] myObjects;
myObjects = new MyObjectClass [DateTime.DayOfW eek];
myObjects [DayOfWeek.Monda y] = new MyObjectClass() ;
myObjects [DayOfWeek.Tuesd ay] = new MyObjectClass() ;
but C# says array subscript must be int type
How best to do this.
1) what is syntax for cardinality of DayOfWeek enum?
2) what is 1st and last of enumeration?
e.g.
for (DayOfWeek index=low(DayOf Week);
index <= high(DayOfWeek) ; index++)
{ . . . }
Gregg
Comment