I've never done this before and can't find the answer. This may not be the correct data type to use for this, but I just want to assign an int, then another int without a for loop into a 2D array, the values will actual be returns from another function, but for simplicity I've just used int i and k, this is how I thought you'd do it, but its not:
int contents[][] = new int[2][2];
contents[0][0] = {int i, int k}
contents[1][1] = {int i, int k}
contents[2][2] = {int i, int k}
TIA - feel free to point me in the direction of a better data struct to do this if I'm barking up the wrong tree.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…