take a look at
srand() which is the usual place for getting random numbers. You can also look in both the tutorials and snippets sections of this site for more example.
If you search the C++ forum you will find a good number of other posts of sudoku.
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
Post your code like this:

Thanks.