hey guys,
i'm working on a program right now that reads 2 types of data in from a file and stores it into two different 2-d arrays. after the read in, i tried to group the arrays into 3x3 blocks. so there are 210 initial readings with 70 3x3 blocks. after doing this i need to examine each block to see if they are within 1 (reading from file) of each other. I am having trouble with the examining part. i posted my code thus far but am now stuck on how to examine the blocks surrounding the middle one. if anyone has any suggestions please let me know. thanks in advance.
Code:int main() { double frequency[209][209]; double intensity[209][209]; int count; int col; int midA; int midB; ifstream inFile; inFile.open("C:\\project6\\sensory-image.txt"); for(count=0;count<210;count++) { for(col=0;col<210;col++) { inFile >> frequency[count][col] >> intensity[count][col]; } } inFile.close(); for(midA=1;midA<71;midA++) { frequency[midA][midD] = frequency[count+1][col+1]; intensity[midA][midD] = frequency[count+1][col+1]; count = count+3; for(midB=1;midB<71;midB++) { frequency[midA][midD] = frequency[count+1][col+1]; intensity[midA][midD] = frequency[count+1][col+1]; col = col+3; } }