Check out example codes for "C# array method reading and returning new array". It will help you in understanding the concepts better.

Code Example 1

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);
                }
            }
        }

Learn ReactJs, React Native from akashmittal.com