Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSetting Folder Permission During Installation Pin
KMerker22-Jan-08 8:11
KMerker22-Jan-08 8:11 
General"an unnamed file contained an unexpected object" Pin
Dave Calkins22-Jan-08 7:35
Dave Calkins22-Jan-08 7:35 
GeneralRe: "an unnamed file contained an unexpected object" Pin
Dave Calkins22-Jan-08 7:43
Dave Calkins22-Jan-08 7:43 
GeneralRe: "an unnamed file contained an unexpected object" Pin
Stephen Hewitt22-Jan-08 12:30
Stephen Hewitt22-Jan-08 12:30 
QuestionWhat is the syntax of a static int array to array structure? Pin
Hakan Bulut22-Jan-08 5:46
Hakan Bulut22-Jan-08 5:46 
AnswerRe: What is the syntax of a static int array to array structure? Pin
David Crow22-Jan-08 5:59
David Crow22-Jan-08 5:59 
GeneralRe: What is the syntax of a static int array to array structure? Pin
Hakan Bulut22-Jan-08 6:24
Hakan Bulut22-Jan-08 6:24 
AnswerRe: What is the syntax of a static int array to array structure? Pin
Florin Crişan22-Jan-08 6:02
Florin Crişan22-Jan-08 6:02 
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 Wink | ;)

Florin Crisan

GeneralGDI+ region and rects Pin
bob1697222-Jan-08 5:29
bob1697222-Jan-08 5:29 
GeneralRe: GDI+ region and rects Pin
CPallini22-Jan-08 5:37
mveCPallini22-Jan-08 5:37 
GeneralRe: GDI+ region and rects Pin
bob1697222-Jan-08 6:30
bob1697222-Jan-08 6:30 
GeneralRe: GDI+ region and rects Pin
Mark Salsbery22-Jan-08 6:17
Mark Salsbery22-Jan-08 6:17 
GeneralRe: GDI+ region and rects Pin
bob1697222-Jan-08 6:32
bob1697222-Jan-08 6:32 
GeneralRe: GDI+ region and rects Pin
Mark Salsbery22-Jan-08 6:45
Mark Salsbery22-Jan-08 6:45 
Questionhow to create Vista style MFC tool bar Pin
sarat22-Jan-08 4:26
sarat22-Jan-08 4:26 
Generalsend continuos data to an edit control for display Pin
LCI22-Jan-08 3:49
LCI22-Jan-08 3:49 
QuestionRe: send continuos data to an edit control for display Pin
CPallini22-Jan-08 3:56
mveCPallini22-Jan-08 3:56 
QuestionRe: send continuos data to an edit control for display Pin
David Crow22-Jan-08 4:16
David Crow22-Jan-08 4:16 
GeneralRe: send continuos data to an edit control for display Pin
LCI22-Jan-08 5:14
LCI22-Jan-08 5:14 
GeneralRe: send continuos data to an edit control for display Pin
David Crow22-Jan-08 5:55
David Crow22-Jan-08 5:55 
GeneralRe: send continuos data to an edit control for display Pin
krmed22-Jan-08 7:13
krmed22-Jan-08 7:13 
GeneralRe: send continuos data to an edit control for display Pin
Wes Aday22-Jan-08 4:31
professionalWes Aday22-Jan-08 4:31 
GeneralRe: send continuos data to an edit control for display Pin
LCI22-Jan-08 4:57
LCI22-Jan-08 4:57 
GeneralRe: send continuos data to an edit control for display [modified] Pin
Cedric Moonen22-Jan-08 4:35
Cedric Moonen22-Jan-08 4:35 
Questionhow to calculate any amont minimum? Pin
gentleguy22-Jan-08 2:54
gentleguy22-Jan-08 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.