how do I address to the 3rd dimension?

Why do I get the error too many initializers values?
I have a 3D array that is set up as 2 12 2, and I should be good right?

1
2
3
4
5
6
7
8
9
10
11
12
13
	double A[2][12][2] =
	{
		
		{ 
			{ 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2 },
			{ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2 }, 
						 
			{ 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2 },
			{ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2 }
		}

		
	};
Last edited on
I should be good right?
No, it's supposed to look like this:
1
2
3
4
5
6
7
	double A[2][12][2] =
	{
		
			{ { 1.1.1, 1.1.2}, ...  {1.12.1, 1.12.2} },
			{ { 2.1.1, 2.1.2}, ...  {2.12.1, 2.12.2} }
		
	};
okay so just like this then,
1
2
3
4
5
6
7
8
9
10
void main(){
	double A[2][12][2] =
	{
		{ { 1.1, 1.2 }, { 1.3, 1.4 }, { 1.5, 1.6 }, { 1.7, 1.8 }, { 1.9, 2.0 },{ 2.1, 2.2 },
		  { 2.1, 2.2 }, { 2.3, 2.4 }, { 2.5, 2.6 }, { 2.7, 2.8 }, { 2.9, 3.0 },{ 3.1, 3.2 } },
						 
		{ { 3.1, 3.2 }, { 3.3, 3.4 }, { 3.5, 3.6 }, { 3.7, 3.8 }, { 3.9, 4.0 },{ 4.1, 4.2 },
		 { 2.1, 2.2 }, { 2.3, 2.4 }, { 2.5, 2.6 }, { 2.7, 2.8 }, { 2.9, 3.0 },{ 3.1, 3.2 } }
		
	};

Thanks,
Last edited on
Topic archived. No new replies allowed.