backendgym backendgym · reps Sign in with GitHubSign in

01Where the copy happened

csharp-reading / reps/01/README.md

Read Program.cs first, then run it: dotnet run --project reps/01. It prints:

a: 0
b: 0, 1
c: 1

counters[0].Bump() compiled without a warning.

After the rep
  1. 1 Why is a 0? What did counters[0].Bump() change, and what happened to it right after?
  2. 2 Line c uses the same struct and the same method. What does an array do differently from a List<T> here?
  3. 3 counters[0].Bump() compiled silently. What would you need to know to catch it in somebody else's pull request?