running a for loop in a foreach loop
<p>I have to write the contents in this format</p>

<pre><code>somename1  value1 value2 value1 value2 ....
somename2  value1 value2 value1 value2 ....
somename3  value1 value2 value1 value2 ....
somename4  value1 value2 value1 value2 ....
somename5  value1 value2 value1 value2 ....
</code></pre>

<p>value1 and value2 are the part of the x and y co-ordinates of a point, so for this I have created a class:</p>

<pre><code>class Points
{
 string name;
 double[] X;
 double[] Y;
}

class PointsCollection
{
  List&lt;Points&gt; aPoints
}

//now when accessing the PointCollection
foreach(Points aPoints in PointsCollection)
{
   stream.Write(aPoints.Name)
   //now i have to write the value1 and valud2

}

possible code

//now when accessing the PointCollection
foreach(Points aPoints in PointsCollection)
{
   stream.Write(aPoints.Name)
   int length1 = aPoints.Real;
   int length2 = aPoints.Imag;
   for(int i = 0 ; i &lt; length1; i++)
   {
            stream.Write(aPoints.Real[i]);
            stream.Write(",");
            stream.Write(aPoints.Imag[i]);

    }
     stream.WriteLine();

}
</code></pre>

<p>Question : Is it the correct to use for loop inside the foreachloop?</p>
