Next LINUX error-general Linux technology-Linux programming and kernel information. The following is a detailed description. Write a 9x9 Sudoku game in C, and use numbers 1-9 to be unique in each row and column. After compilation with GCC is successful, the system always prompts "segment error" when running the program"
Here, I wrote a recursive function. The function is: when each number is written, it is determined that if the number in this column is not unique in this row, the number is removed until the condition is met. After this function is recursively run for N times when I use GDB for tracking, the following error message is displayed: Segment error,. What is the problem ,,,? This function is shown in the following example: Please help me solve it with experienced prawns.
Void cs_num (int z [], int m [], int n, int x, int d [] [9]) {
Int g, p, h;
For (g = 0; g P = m [g];
D [x] [p] = z [g];}
H = camp (z, m, n, x, d );
Printf ("% d \ n", h );
If (h> = 0 ){
Swapshuzu (z, m, n );
Cs_num (z, m, n, x, d );}}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service