HI! I need help! please somebody help me! I need program Sudoku in language C or C++, but I can't programming. please send me source code
thanks very much!
this program is very important for me, because I need this in school

Dani AI

Generated

asked for a ready-made Sudoku program in C/C++. pointed to the forum rules and correctly reminded that just asking for code without showing effort rarely works. Useful advice here is a short learning plan plus concrete, verifiable resources so the OP can produce working code and learn at the same time.

Start small: represent the board as a 9x9 integer array with 0 for empty cells. Implement a small isValid helper that checks a row, a column, and the 3x3 block for conflicts. Next add a recursive backtracking routine that finds the first empty cell, tries digits 1..9, calls isValid, recurses, and backtracks on failure. That approach is simple and solves typical puzzles fast; a step-by-step walkthrough is available at the GeeksforGeeks backtracking page (simple backtracking walkthrough). For high-performance or generator work, study Knuth's Algorithm X / Dancing Links (Dancing Links). To see many working C/C++ examples and compare styles, look at the Rosetta Code Sudoku page (implementations in many languages).

Practical tips: test the validator thoroughly (row/col/box index math is the usual bug), print intermediate boards while debugging, and start with very small helper functions. If this is schoolwork, write the code yourself and post any specific compile/run errors with the code you tried; that makes focused help possible.

Recommended Answers

All 3 Replies

thanks very much, but where is the source code?

Read the link above. No effort on your part = no source code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.