im trying to create a sudoku puzzle that is 9x9 already completed and filled in with numbers having no rep in row, column, or smaller 3x3 grid. (just like the real deal sudoku puzzles)

here is what i have and it gives me a grid with repititions now just how would i turn this into a grid without repititions which is then a sudoku puzzle.

**[code]**

# include <iostream>

# include <ctime>

# include <iomanip>

using namespace std;

int random (int grid[][9], int i, int j)

{

srand(time(0));

for (i=0; i<9; i++)

{

for (j=0; j<9; j++)

{

grid[i][j] = rand()%9 + 1;

}

}

return 0;

}

**[code]**

this is merely a function that i link together for the entire program yes i have everything initialized and also grid is a 2D array.

how do i pass back the contents i then enter into the 2D array?? i have it just returning 0 because i don't know how to pass it back through.

Help will be much appriciated!

Thank you all!!