Can I be so bold as to ask what was changed?
P.S. Of course the thing crashes when it runs, but I don't care, I just want to know what I did wrong syntax-wise.
Main Topics
Browse All Topics...and I need some help in making my program, you know, compile.
I mean, the fact that the code is really inefficient is beside the point. I just want this thing to come out on the other side of my compiler.
I took out a huge chunk of really simple commands that I know are done correctly. I commented it where I took it out from. I'm trying to make it easy on you experts.
I think my main problem is that I have no understanding on how functions are called and also that I'm really poor at managing arrays. I think I've tried to declare an array in about 50 different incorrect ways at once. However, I'm fairly sure that I've semi-coloned and bracketed OK... fairly sure...
Really, people, save me from myself.
What rules do I seem unaware of?
P.S. You may find that I've taken an extra step (such as initializing a variable that's used only once). This is most likely because I was trying to make things as simple as possible when I tried to debug things myself. Just an explanation in case you get confused.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
& is not the same as &&. The first is the binary AND operator - the second is the logical AND operator.
The 'if' test needs to be enclosed in ()'s.
Functions have to specify the types of their arguments.
In programming, if you are unsure about something, don't start guessing, as you'll only make things worse. Instead, look it up. Here's a basic tutorial that can be of great assistance :
http://www.cplusplus.com/d
I really encourage you to read it. Especially the part about arrays, since that's what you claim to have most problems with.
Notice that that same site also holds a reference of the standard libraries, including STL.
I believe a "C" rating is when something is missing in the answer or is unclear--neither of which was true here, as you correctly assumed.
You answered "good", providing the changed code and, separately, what was wrong. An "Excellent" could have been achieved by quoting the lines of code that were wrong, writing the fixed code, and explaining why the change was necessary--doing this for each error would have earned an "A" rating-clear, correct, concise.
Your combined answer was certainly fine, correct, and gave me what I needed--I wasn't going to come back and say "oh, I'm still not satisfied". I wasn't going to keep the question open (because it was answered correctly), but it wasn't "A" material either.
fyi :
http://www.experts-exchang
ie. if the question was completely answered, an A grade is appropriate. A B grade indicates that something was missing. And in that case, I always point out that the asker can ask further clarification about the missing parts.
So, as I said : if further assistance is needed (the B grade suggests that that's the case), then do not hesitate to ask for clarification. The point is that we try to answer your question with an A grade answer - so you don't have to settle for anything less ;)
Business Accounts
Answer for Membership
by: ozoPosted on 2008-09-04 at 17:24:18ID: 22394168
// correcting syntax so it at least compiles
s[i],queen s[j]);
]){ //horizontal and vertical check { //diagonal down-left to up-right { //diagonal down-right to up-left
#include <cstdlib>
#include <iostream>
using namespace std;
void mapout(int);
bool comptwo(int[2], int[2]);
bool checkall();
int placeq(int,int,int);
void printmap();
int pathnum=1; //how many queens are on the board right now?
int queens[8][2]={}; //the set of queens. I used a 8x2 table (even though the first column will always be the same, 1-8) so that the program is expandable.
int xplace;
int yplace;
int nq;
int main(void)
{
int hits=0;
while(hits<1){ //this is if we want to find one result.
for (int row=1;row<9;row++){
int stopit=0;
for (int col=1;col<9 & stopit<1;col++){
placeq(row,col,pathnum);
pathnum++;
if (checkall()==true){
stopit=1;
pathnum++;
}
pathnum--;
}
if (stopit==0){
pathnum--;
row--;
}
}
}
printmap();
}
bool checkall(){
int compareworks;
for (int j=1;j<pathnum+1;j++){
for (int i=1;i<pathnum+1;i++){
compareworks=comptwo(queen
if (compareworks==0 & j!=i){
return false;
}
}
}
}
bool comptwo(int c1[2], int c2[2]){
if (c1[1]==c2[1]||c1[2]==c2[2
return false;
}
if (c1[1]+c1[2]==c2[1]+c2[2])
return false;
}
if (c1[2]-c1[1]==c2[2]-c2[1])
return false;
}
return true;
}
void mapout(int place){
//some really basic but long code went here...
}
void printmap(){
for (int i=1; i<9; i++){
for (int j=1; j<9; j++){
if( queens[j][1]==i ){
mapout(queens[j][2]);
}
}
}
}
int placeq(int xplace,int yplace,int nq){
queens[nq][1]=xplace;
queens[nq][2]=yplace;
pathnum=nq;
return 1;
}