It can be much more clean, declarative and nice in C#, for example:
//In .NET both lists and arraus implement IList interface, so we don't care what's behind
//A parameter is just a sequence, again, we just enumerate through
//and don't care if you put array or list or whatever, any enumerable
public static IList<string> GenerateMacroStuff(IEnumerable<string> macroInits) {
{
return macroInits
.Select(x => x + "some random string or function returns that") //your re-initialization
.Select(x => YourDoSomeStuff(x)) //what you had in your foreach
.ToArray();
}
And it can be used then:
var myInits = new[] {"Some init value", "Some init value 2", "Another Value 3"};
var myMacroStuff = GetMacroStuff(myInits); //here is an array of what we need
BTW, we can suggest you a solution how to "do stuff" properly and nicely if you just describe what you want, not just show us a code we don't have any clue how to use and ask how to translate it literally.
Because a literal translation can be so unnatural and ugly in .NET world, and you will have to maintain this ugliness... We don't want you to be in this position :)