for( int i = 0; i < n; i++ )
for( int j = 0; j < n; j++ )
myFile.write( (char*)&count[i][j], sizeof(int) );
to write each integer separately, or myFile.write( (char*)&cout[0][0], n*n*sizeof(int) );
to write them all together.
The result will be the same if the array is static. Though you might want to write n first, so that you know how much to read when you need to.