Quantcast
Channel: Answers by "jaskij"
Viewing all articles
Browse latest Browse all 37

Answer by jaskij

$
0
0
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.

Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>