I think you mean
int calcTotal(int sales[6][2])
//declare variables
int company = 0;
//sales accumulator
for (int row = 0; row < 6; row = row + 1)
for (int col = 0; col < 2; col = col + 1)
//accumulate sales
company = company + sales[row][col];
//end for col
//end for row
return company;
} //end of calcTotal function

that should work if you array is always going to be fixed to [6][2] but will not if the size varies.

Hope this helps.


I see you typo it should rather read

[CODE]typedef int HashElement[/CODE]

You misspelled typedef. Also as Ancient Dragon says include using std::string;

A piece of advice, in all your c++ programs always put without fail using namespace std; to read something like



using namespace std;

That should work

I think when you have complex roots none of your conditions are being met hence the error is not being printed. Your opening for loop:

for (double j = -50; j <= 51; j=j+0.1)[/CODE]

cout<<j<<endl; to see the result, I do not think it actually reaches 51 hence the if(j==51) does not turn true.

Have a look at it.