Warning: missing braces around initializer

1
2
3
4
5
6
7
8
9
10
s8 affinity[8][8]={
	1,	2,	0,	2,	0,	1,	1,	1,
	0,	1,	1,	2,	0,	0,	2,	2,
	2,	1,	1,	0,	2,	0,	2,	0,
	0,	0,	2,	1,	1,	2,	0,	2,
	2,	2,	0,	1,	1,	2,	0,	0,
	1,	2,	2,	0,	0,	1,	1,	1,
	1,	0,	0,	2,	2,	1,	1,	1,
	1,	0,	2,	0,	2,	1,	1,	1
};

Before you say anything, s8 has been replaced with int and I still get the error, so that's not it. s8's just the format I have to use right now...
Where am I supposed to put the extra braces 0.o?
Try with using braces for each row:
1
2
3
4
5
s8 affinity[8][8]={
	{ 1,	2,	0,	2,	0,	1,	1,	1 },
	{ 0,	1,	1,	2,	0,	0,	2,	2 },
	...
};
It works perfectly! Thanks!

I get the reasoning behind the system now, it's an array of arrays so each array has to have braces...
Topic archived. No new replies allowed.