for(c = 0; c < numCols; c++)
{
oper[c] -= data[r*numCols+c];
oper[c] = oper[c] * oper[c];
sum += oper[c];
}


oper array max indice you can get safely is oper[numCols-2]....