struct TWidget
{
int MemAvail;
int MemOffset;
};
static TWidget Widget[2] =
{
{0x100,0x200},
{0x120,0x400}
};
In my app I can just refer to Widget[Model].MemAvail which will give me
the amount of available memory for any model. When we release a new model,
I just add a new layer to the array...
How can I convert it to C#? So far I can find no syntax that works.
> struct TWidget
> {
> int MemAvail;
> int MemOffset;
> };
>
> static TWidget Widget[2] =
> {
> {0x100,0x200},
> {0x120,0x400}
> };
>
> In my app I can just refer to Widget[Model].MemAvail which will give me
> the amount of available memory for any model. When we release a new model,
> I just add a new layer to the array...
>
> How can I convert it to C#? So far I can find no syntax that works.
You could do something like:
struct TWidget
{
int MemAvail;
int MemOffset;
internal TWidget(int a, int o) { MemAvail = a; MemOffset = o;
}
};
class Program {
static TWidget[] Widget = {
new TWidget(1,2),
new TWidget(2,4)
};
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
I use this a lot for lookup tables in conversion routines.
What about some sort of constant declaration?
As an alternative I am considering loading the tables from files, or
possible program resources.