After googling Arduino and C++ I have found that I need a nested loop to add variable data to a 2 dim array. This is my test sketch.
const int numRows = 3;
const int numCols = 2;
float cel, farh; //variables for Celcius and Farenheit
for (int row = 0; row < numRows; row++) //This loops on the rows.
for (int col = 0; col < numCols; col++) //This loops on the columns
myArray[row][col] = (cel); // first time thru row=0 and col=0. this is entered in the array
myArray[row][col] = (farh);// second time thru row still equals 0 and col=1 which I believe is correct
// the value farh does not get entered
My understanding of the nested loop is that first time thru the outer loop keeps the value of 0 untill the inner loop completes it’s loops thru 0 and 1 then reverts back to the outer loop which becomes value of 1 and repeats. I hope that is correct.
First time thru cel is placed in location 0,0 … How am I able to get farh into location 0,1
Also do I need some kind of exit strategy to get out of the nested loop situation?