Adding to a 2d array?

How do I do this? I just want to be able to access its contents by array[x][y], but apparently that doesn’t work for setting them, only reading. Anyone know?