using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { B b = new B(10); A[] a = b.MakeSomeA("TEST"); foreach(A it in a) Console.WriteLine(it.str); } } class A { public string str; public A(string s) { str = s; } } class B { public A[] ins_a; public int num; public B(int x) { num = x; ins_a = new A[num]; } public A[] MakeSomeA(string s) { for (int i = 0; i < num; i++) ins_a[i] = new A(s); return ins_a; } } }