How to access an object instance which is inside an object array?
<p>I am trying to access an object which is a member of an object array, is that possible ?</p>

<p>I have declared a structure named Particle, and initialized an object array of "Particle" about 40 particles,now I need to access each particle, for ex: particle.Gbest 
any one can help ??</p>

<p>here is my code:</p>

<pre><code>struct particle
{
    double[] position = new double[100];
    double Gbest, Lbest;
    double Pconst = 0.5;
}

object[] swarm = new object[swarm_size];

for (int i = 0; i &lt; swarm_size; i++)
{
    swarm[i] = new particle();
}
</code></pre>
