How to do "Compile time" initialization of record array?



Back in the "old" days with C, I used to do something like...

struct
{
char Description[20];
float price;
} Items[] =
{
{"Apple", 1.99},
{"Banana", 2.04}
};

If I wanted to do something similiar (and I do), does anyone have hints for
an obviously new C# programmer?

Any help is greatly appreciated,
John Kelsey


.



Relevant Pages

  • Re: understanding LPARAM
    ... my application is build on top of code that comes from Intel. ... struct which has an attribute called ID and that type of char*. ... Prev by Date: ...
    (microsoft.public.pocketpc.developer)
  • How to parse and call c++ constructors?
    ... But to make this usefull, I wanted to fill up a datastructure: ... struct B { ... char* text; ... Prev by Date: ...
    (comp.compilers)
  • [PATCH]a tar filesystem for 2.6.10-rc1-mm3
    ... +static int tarfs_readdir(struct file * filp, ... struct tarent *dir_tarent, *ent; ... +static int tarfs_readlink(struct dentry *dentry, char *buffer, int buflen) ...
    (Linux-Kernel)
  • [PATCH] a tar filesystem for 2.6.*(easily access tar file)
    ... +static int tarfs_readdir(struct file * filp, ... struct tarent *dir_tarent, *ent; ... +static int tarfs_readlink(struct dentry *dentry, char *buffer, int buflen) ...
    (Linux-Kernel)
  • [PATCH]a tar filesystem for 2.6.10-rc1-mm3
    ... +static int tarfs_readdir(struct file * filp, ... struct tarent *dir_tarent, *ent; ... +static int tarfs_readlink(struct dentry *dentry, char *buffer, int buflen) ...
    (Linux-Kernel)