C# Developers' Journal (original) (raw)

initialization why is that I can say

const string my = "whatever";

but can't say

const string[] my = {"whatever", "that is"};

the second line will make compiler mumble "Array initializers can only be used in a variable or field initializer" as if I am trying to initialize something inappropriate. and, if I change it to

readonly string[] my = {"whatever", "that is"};

everything's suddenly cool. WHY? what am I missing?