What is the syntax of a static int array to array structure?
-
static int* arCombs[6][11] = { // Syntax error. arCombs[0] = {i1,i2,i3,i4,i5,i6}; arCombs[1] = {i7,i8,i9,i10,i1,i2}; arCombs[2] = {i8,i9,i10,i1,i2,i3}; arCombs[3] = {i9,i10,i1,i2,i3,i4}; arCombs[4] = {i10,i1,i2,i3,i4,i5}; arCombs[5] = {i1,i2,i3,i4,i5,i7}; arCombs[6] = {i1,i2,i3,i4,i7,i8}; arCombs[7] = {i1,i2,i3,i7,i8,i9}; arCombs[8] = {i1,i2,i7,i8,i9,i10}; arCombs[9] = {i1,i6,i7,i8,i9,i10}; arCombs[10] = {i5,i6,i7,i8,i9,i10}; };
I need to some help about syntax when i wrote this syntax i am giving a bug this like below: error C2059: syntax error : '{'Please stop this nonsense offer. I noticed about this offer is a statement against the enemy.
-
static int* arCombs[6][11] = { // Syntax error. arCombs[0] = {i1,i2,i3,i4,i5,i6}; arCombs[1] = {i7,i8,i9,i10,i1,i2}; arCombs[2] = {i8,i9,i10,i1,i2,i3}; arCombs[3] = {i9,i10,i1,i2,i3,i4}; arCombs[4] = {i10,i1,i2,i3,i4,i5}; arCombs[5] = {i1,i2,i3,i4,i5,i7}; arCombs[6] = {i1,i2,i3,i4,i7,i8}; arCombs[7] = {i1,i2,i3,i7,i8,i9}; arCombs[8] = {i1,i2,i7,i8,i9,i10}; arCombs[9] = {i1,i6,i7,i8,i9,i10}; arCombs[10] = {i5,i6,i7,i8,i9,i10}; };
I need to some help about syntax when i wrote this syntax i am giving a bug this like below: error C2059: syntax error : '{'Please stop this nonsense offer. I noticed about this offer is a statement against the enemy.
Have you considered:
static int arCombs[11][6] =
{
{i1,i2,i3,i4,i5,i6},
{i7,i8,i9,i10,i1,i2},
{i8,i9,i10,i1,i2,i3},
{i9,i10,i1,i2,i3,i4},
{i10,i1,i2,i3,i4,i5},
{i1,i2,i3,i4,i5,i7},
{i1,i2,i3,i4,i7,i8},
{i1,i2,i3,i7,i8,i9},
{i1,i2,i7,i8,i9,i10},
{i1,i6,i7,i8,i9,i10},
{i5,i6,i7,i8,i9,i10}
};BTW, unless you are strictly targeting German-speaking readers, you might want to consider changing your profile to English.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
static int* arCombs[6][11] = { // Syntax error. arCombs[0] = {i1,i2,i3,i4,i5,i6}; arCombs[1] = {i7,i8,i9,i10,i1,i2}; arCombs[2] = {i8,i9,i10,i1,i2,i3}; arCombs[3] = {i9,i10,i1,i2,i3,i4}; arCombs[4] = {i10,i1,i2,i3,i4,i5}; arCombs[5] = {i1,i2,i3,i4,i5,i7}; arCombs[6] = {i1,i2,i3,i4,i7,i8}; arCombs[7] = {i1,i2,i3,i7,i8,i9}; arCombs[8] = {i1,i2,i7,i8,i9,i10}; arCombs[9] = {i1,i6,i7,i8,i9,i10}; arCombs[10] = {i5,i6,i7,i8,i9,i10}; };
I need to some help about syntax when i wrote this syntax i am giving a bug this like below: error C2059: syntax error : '{'Please stop this nonsense offer. I noticed about this offer is a statement against the enemy.
I was about to suggest the code below, but then I've tried it in a compiler and I got an error.
static int arCombs[6][11] =
{
{i1,i2,i3,i4,i5,i6},
{i7,i8,i9,i10,i1,i2},
{i8,i9,i10,i1,i2,i3},
{i9,i10,i1,i2,i3,i4},
{i10,i1,i2,i3,i4,i5},
{i1,i2,i3,i4,i5,i7},
{i1,i2,i3,i4,i7,i8}, // error C2078: too many initializers
{i1,i2,i3,i7,i8,i9},
{i1,i2,i7,i8,i9,i10},
{i1,i6,i7,i8,i9,i10},
{i5,i6,i7,i8,i9,i10}
};The dimensions are wrong. You are declaring an array of 6 arrays of 11 elements, not an array of 11 arrays of 6 elements. But you only initialize 6 of those 11. The rest get the default value, 0. So the correct way should be:
static int arCombs[6][11] =
{
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11},
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11},
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11},
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11},
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11},
{i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11}
};or even
static int arCombs[6][11] =
{
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,
i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11
};I just copied and pasted the values, but you get the picture ;)
Florin Crisan
-
Have you considered:
static int arCombs[11][6] =
{
{i1,i2,i3,i4,i5,i6},
{i7,i8,i9,i10,i1,i2},
{i8,i9,i10,i1,i2,i3},
{i9,i10,i1,i2,i3,i4},
{i10,i1,i2,i3,i4,i5},
{i1,i2,i3,i4,i5,i7},
{i1,i2,i3,i4,i7,i8},
{i1,i2,i3,i7,i8,i9},
{i1,i2,i7,i8,i9,i10},
{i1,i6,i7,i8,i9,i10},
{i5,i6,i7,i8,i9,i10}
};BTW, unless you are strictly targeting German-speaking readers, you might want to consider changing your profile to English.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
static int arCombs[11][6] = { {i1,i2,i3,i4,i5,i6}, {i7,i8,i9,i10,i1,i2}, {i8,i9,i10,i1,i2,i3}, {i9,i10,i1,i2,i3,i4}, {i10,i1,i2,i3,i4,i5}, {i1,i2,i3,i4,i5,i7}, {i1,i2,i3,i4,i7,i8}, {i1,i2,i3,i7,i8,i9}, {i1,i2,i7,i8,i9,i10}, {i1,i6,i7,i8,i9,i10}, {i5,i6,i7,i8,i9,i10} };
This is okey thanks..Please stop this nonsense offer. I noticed about this offer is a statement against the enemy.