Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understand something. I have this code here that is basically a program that solves all 92 eight queens solutions, but prints it out in a 1D array of 8 numbers like an odometer. Each number tells you how many boxes down to go to put a queen inside (You go down the required number of boxes and then put a queen in the next one. EX: 47302516 - you put a queen in boxes 5,8,4,1,3,6,2,7 if you want to think about it from a non-programmer's perspective instead of starting from 0 because of the array going from 0 - 7). Now this program works perfectly fine, but I want to know why I have to declare the "int q[8]; int c;" variables as global for it to work. If I don't, the program just prints out nonsense.
Here is the working program:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include
And here is the program that prints out nonsense:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include
Any insight into this would be greatly appreciated for this aspiring C++ programmer :]. I want to know what I would have to change for it to work if the variables weren't global. I know it has to be something with the way I'm passing the variables through the functions, but I'm not sure. Thanks again guys.
Please help - should be a simple fix.. driving me nuts
Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and relivant city data.However, I found out that the city is showing up only one time when I have can
Sequre login with cookies.
I want to build secure login with cookies. I just want your ideas about this, your suggestions. What fields should go to sql table, after username and password? How to keep data in cookies safely? And
PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) about using AJAX and a database. It's my first time actually using AJAX and I've run into a problem.
Help? Need help on project with templates involving mysql and php.
I'm having a hard time explaining what I want but basically here is what I have in place:-Database with 500 members signed up and using under a table called 'users'-Php page that people click a link
get font info from a font file
hello,Does anyone know how to get font info from a font file ... using php of course ! The stuff I need to extract is Font Family, Author, Copyright etc which is contained as attributes in the font
Mail functionality from localhost to server
Hi I am facing problem of mail functionality.When i tested mail functionality in my localhost it works fine but when i tried it on server it didn't work and also no error it displays.So please give me
Format String help
I have a textbox where a person enters an application number. the application number is 10 characters in length:ex: 000012345A0256775434My clients only want to enter in the numbers without the
in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a would do)Example:<a href="#">like</a></td> <td><a
Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jpg"/> it will send this &lt;img src="image.jpg"&gt;
Image resize
Hi again fellersI managed to sort out the issues with the folder, Final hurdle is this: Code: function ResizeJPEG($filename, $width, $height){ list($width_orig, $height_orig) =