私は本当に関数である配列を持っていますが、配列として使用したいと思います。私はこれらを書くことができると知っています[]のように関数を実装する
int var { get{return v2;} }
public int this[int v] { get { return realArray[v]; }
しかし、どのように私は配列のような機能を実装するのですか?私は
public int pal[int i] { get { return i*2; } }
ような何かをしたいと思いますしかし、それは、C#でコンパイルエラー
error CS0650: Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type.
error CS0270: Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
コード例? –