Hi,
I'm currently trying to draw shapes with 2D Arrays. In my class there is a global array defined with public char canvas[][];
Up until now, I have only declared arrays with char canvas[][] = new char[height][width];
If this Array has already been declared, and I'm not supposed to amend the code I've been given, how do I call an instance of that array so that I can use it?
thanks.
(edit)
class DrawingSystem {
public char canvas[][];
public static void makeNewCanvas(int tmpWidth, int tmpHeight) {
canvas[][] = new char[tmpHeight][tmpWidth];
for (int row=0; row<tmpHeight; row++) {
for (int col=0; col<tmpWidth; col++) {
canvas[row][col] = ' ';
}
}
}