grid is not a global, it is local to the main function. Change this:
int nonrecursivecountcells(color[ROW_SIZE][COL_SIZE], int row, int column)
to this:
int nonrecursivecountcells(color grid[ROW_SIZE][COL_SIZE], int row, int column)
Basically you forgot to give that first param a name, grid will do since it matches your code.