What is it supposed to do? I think you meant to iterate the array by varying i and j instead of row and column. In other words, check this line:

if ( first[row][col] == 0 ) //if the location was...