C# array method reading and returning new array code example
Example: C# array method reading and returning new array
static void Read(string fv, Person[] P, Money[] M, out int n)
{
int mon;
string nm;
int eu;
int ct;
using (StreamReader reader = new StreamReader(fv))
{
string line;
line = reader.ReadLine();
string[] parts;
n = int.Parse(line);
for (int i = 0; i < n; i++)
{
line = reader.ReadLine();
parts = line.Split(';');
nm = parts[0];
eu = int.Parse(parts[1]);
ct = int.Parse(parts[2]);
mon = eu * 100 + ct;
P[i] = new Person(nm, eu, ct);
M[i] = new Money(mon);
}
}
}