First of all, what are you attempting in the nested loops in the main()?
doesn't do anything.
Did you intend to initialize the array:
grid[count][count1] = ' ';
I'm not sure your
routine is actually what you want.
Instead of starting with printing the board,
start with solving the problem.
Think about how you would do it manually:
Get (or draw) a chessboard (8x8 grid)
get 8 markers to represent the queens.
Get some markers to represent HOW MANY queens are attacking a position.
(In the US, I'd use 8 Quarters and a lot of pennies.)
Place a "queen" in the first position of the first row and then place a marker in every position that the queen could attack.
Place a second queen in the first open position of the second row.
Add a marker to the positions the second queen could attack. Some positions will have 2 markers!
repeat adding queens until you've placed the 8th queen or there are no open positions.
If there are no open positions, remove the last placed queen, remove the corresponding markers from that queen, and place the queen in the next
Keep placing and removing queens and markers until the 8th is placed.
Now try to implement this in code.
Think about what the grid data structure needs to be.