IMO, the point here is that currenCommand is a reference too. So you only enqueue reference to the array which you change.
I'm new to C# as well (similar circumstances to You), but if C# supports copy constructor for char[] then this should help:
currentCommand = new char[](inputReader.GetCurrentCommand());
this way, you enforce a full copy of that char
Remeber, that unless it's a primitive (and arrays aren't so AFAIK) the default is a shallow copy - only the reference is copied, not the value itself.
↧