1. ## random output

i am using codeblocks and i am having problems, this is the code:
Code:
```#include <iostream>

using namespace std;

int main()
{
long long int highest = 0;
int grid [20][20] = // i initialize the array here
cout << endl << "benchmark 1/n";
for(int a=0; a < 20; a++)
{
for(int b=0; b < 17; b++)
{
if(highest < (grid[a][b]*grid[a][b+1]*grid[a][b+2]*grid[a][b+3]))
{
highest = (grid[a][b]*grid[a][b+1]*grid[a][b+2]*grid[a][b+3]);
}
}
}
cout << "benchmark 2/n";
for(int a=0; a < 17; a++)
{
for(int b=0; b < 20; b++)
{
if(highest < (grid[a][b]*grid[a+1][b]*grid[a+2][b]*grid[a+3][b]))
{
highest = (grid[a][b]*grid[a+1][b]*grid[a+2][b]*grid[a+3][b]);
}
}
}
cout << "benchmark 3/n";
for(int a=0; a < 17; a++)
{
for(int b=0; b<17; b++)
{
if(highest < (grid[a][b]*grid[a+1][b+1]*grid[a+2][b+2]*grid[a+3][b+3]))
{
highest = (grid[a][b]*grid[a+1][b+1]*grid[a+2][b+2]*grid[a+3][b+3]);
}
}
}
cout << "benchmark 4/n";
for(int a=0; a<17; a++)
{
for(int b=0; b < 20; b++)
{
if(highest < (grid[a][b]*grid[a+1][b-1]*grid[a+2][b-2]*grid[a+3][b-3]))
{
highest = (grid[a][b]*grid[a+1][b-1]*grid[a+2][b-2]*grid[a+3][b-3]);
}
}
}
cout << "benchmark 5" << endl;
return 0;
}```
however the output is just a bunch of random numbers
the benchmarks do not show up.
what the heck is going on?

2. The only thing you're outputting in the posted code are the strings:
Code:
`benchmark 1/nbenchmark 2/nbenchmark 3/nbenchmark 4/nbenchmark 5`
(Presumably you meant to use backslashes and not the forward slashes you used.)

If your program used to output anything else, you've removed it from the code you posted.
Also, you should include the initialization of grid, otherwise we can't run it.

And you can remove some ugly (and error prone) repetition like this:
Code:
```    long long int highest = 0, m;
int grid [20][20] = // i initialize the array here

cout << endl << "benchmark 1/n";
for(int a=0; a < 20; a++)
for(int b=0; b < 17; b++) {
m = grid[a][b]*grid[a][b+1]*grid[a][b+2]*grid[a][b+3];
if(highest < m)
highest = m;
}```
I think it's also necessary to cast the first grid[][] to long long to prevent overflow:
Code:
`            m = (long long)grid[a][b]*grid[a][b+1]*grid[a][b+2]*grid[a][b+3];`

3. the problem must not be with my code then, i didn't get the same output, as i said before the output was a bunch of random numbers eg:
Code:
``` 92304920934 902318749018 38974492836 23489374 -234719 347923
2349082384 3234 43 093284934 -42934879 0930492304```
i tried rebooting codeblocks, no change
i tried using rebuild, no change
when i copied and pasted the code into a new project it worked.

what could cause a problem like this?
also, please explain the last bit of code, idk what it means

4. what could cause a problem like this?
idk
please explain the last bit of code, idk what it means