Help with this For Loop

This is a discussion on Help with this For Loop within the C++ Programming forums, part of the General Programming Boards category; Here is part of my code. The rest is just the function definitions. .I have an array of 20 x ...

Help with this For Loop

Here is part of my code. The rest is just the function definitions. .I have an array of 20 x 20 that outputs the temperature of a plate. I need to reiterate through a loop until no cell in the array changes more than 0.1 degree(I refresh the values through every iteration. How would you monitor the largest change for any cell in an array in order to determine when to stop iterating? Right now I have tried, but the below doesn't output correctly. I believe it is because I am incorrectly defining my previous one to compare the current one with. Any ideas?

all of your instances of "b < array_size - 1" should be "b < array_size"
also, array indexes start at zero, not one.

an array of 20 items has indexes 0 to 19, and it looks like your for loops iterate over a range of 1 to 18. I'm only guessing at the value of "array_size" based on your explanation, because it's not declared in your code snippet.