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?