配列があり、この配列の参照を含む2つのクラスを作成したいと思います。配列内の要素の値を変更するとき、クラスの変更を確認したいと思います。私がそれをしたい理由は、私は何かの配列を持っていて、この配列を含むか到達する必要がある多くのクラスを持っているからです。どうやってやるの?
Cでは、配列のポインターを既存の構造体に配置して問題を解決しますが、C#でそれを行うにはどうすればよいですか?配列ポインタafaikはありません。
int CommonArray[2] = {1, 2};
struct
{
int a;
int *CommonArray;
}S1;
struct
{
int b;
int *CommonArray;
}S2;
S1.CommonArray = &CommonArray[0];
S2.CommonArray = &CommonArray[0];
ありがとうございました。