I have to write the contents in this format
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 ....
value1 and value2 are the part of the x and y co-ordinates of a point, so for this I have created a class:
class Points
{
string name;
double[] X;
double[] Y;
}
class PointsCollection
{
List<Points> 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 < length1; i++)
{
stream.Write(aPoints.Real[i]);
stream.Write(",");
stream.Write(aPoints.Imag[i]);
}
stream.WriteLine();
}
Question : Is it the correct to use for loop inside the foreachloop?