Variable name using another variable

I’m trying to set up arrays for all the containers in my game but having issues with using a variable name to assign another variable.

This is my code. Each container is an array with 10 slots. But I want there to be 3 containers. So if I want to see whats in a certain container I can check container_3[5] etc…

// set up containers
for (int cn = 0; cn < 3; cn++) {

    for (int a = 0; a < 10; a++) {
        {"container_" + cn}[a] = "blah"; <-----------------
        }

    }

Arrowed the line where I’m having issues, how can I do this?

Make an array of your arrays, a.k.a. multidimensional array.

string[][] containers = new string[3][];
 for (int cn = 0; cn < 3; cn++) {
     containers[cn] = new string[10];
     for (int a = 0; a < 10; a++) {
         containers[cn][a] = "blah"; <-----------------
         }
 
     }

use HashTable or Dictionary, if you don’t know what these are learn them, they are important