Unhandled exception?

I appear to get this strange error which I can't solve, could someone please help me?
Error: Unhandled exception at 0x2e232e23 in Game.exe: 0xC0000005: Access violation.

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
 #include  <iostream>
#include <string>
using namespace std;

int i,y;
char board[8][8];
class Checkers {
public:
	void setBoard() {
		for (i=0; i < 8; i++){
			for (y=0; i< 8; y++) {
				if ((i+y)%2==0) {
					board[i][y] = '#';}
				else{
					board[i][y] = '.';
				}
				}
			}
		}
	void printBoard() {
		for (i=0;i<8;i++) {
			for (y=0;y<8;y++) {
				cout << board[i][y];
			}
			cout << endl;
		}
	}
};

int main() {
	Checkers Checks;
	Checks.setBoard();
	Checks.printBoard();
	cin.get();
	return 0;
}
for (y=0; i< 8; y++)
^ Problem.
On line 11...

Also, I don't see why i, y, or board need to be globals?

Andy
I was trying to debug it, during the process I made i and y global as an attempt to debug it.
Topic archived. No new replies allowed.