You use local stack variable for the board, local variables will be deleted on leaving the function, should probably use a global variable. Not sure how d is passed, maxbe init has a parameterLocal variables of same name shadow global ones (compiler flag -Wshadow
will warn in that case).
Your single loop would output just the elements of the diagonale, needs nested loops just like when filling, and break leaves the current loop.