void bar() { struct foo { ... }; foo[] foos = GetFoos(); ... }; foo[] GetFoos() { foo[] foos; foos[0] = newFoo(1); return foos; };