I'm trying to write a program that creates a grid with set values filling each of the 4 outer edges, then fills in the other squares with the average value of their 4 adjacent squares, and keeps doing that until the grid becomes more or less constant.
The program creates grids 1 and 2 with the constant squares filled in and everything else set to 0, averages all the variable squares one at a time in grid 1, then checks grid 1 against grid 2 one square at a time. If any point on grid 1 is more than .001 away from the same point on grid 2, it sets "f" to 1, and then copies grid 1 to grid 2. After the copying, it prints f, checks if f=1, and if so, it goes back to the averaging step, where f is reset to 0. What should happen is, once grid 1 and grid 2 are almost exactly the same, f will stop being set to 1, so the if statement will register false, the goto statement won't trigger, and it'll move onto the next step of printing the grid out. But it's triggering the goto statement whether or not f is 1.
First why are you using goto? This loop construct should only be used very rarely, you should re-factor your code to use one of the other loop constructs.
The goto loop is considered a very bad practice because it leads to non-structured programming. You should learn to properly use functions and the other loop constructs. In this case I suggest a simple do/while{} or while loop.
And I don't know what "operator= is assignment" means. Should I be using "if (1 = f)"?
Do you know the the difference between assignment and comparison?
In C/C++ there is a different operator for assignment, operator= and comparison, operator==. When you want to compare a value use the comparison operator. When you want to assign a value to an object use the assignment operator.
And other than the use of the incorrect operator your loop looks valid.