Click here to Skip to main content
14,303,609 members

C / C++ / MFC

 
GeneralRe: Complex multidimensional array in C++ Pin
Daniel Pfeffer19-Jan-19 22:17
professionalDaniel Pfeffer19-Jan-19 22:17 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_20-Jan-19 4:39
memberVaclav_20-Jan-19 4:39 
GeneralRe: Complex multidimensional array in C++ Pin
Richard MacCutchan20-Jan-19 5:06
protectorRichard MacCutchan20-Jan-19 5:06 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_20-Jan-19 7:15
memberVaclav_20-Jan-19 7:15 
GeneralRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 8:47
memberk505420-Jan-19 8:47 
GeneralRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 8:52
memberk505420-Jan-19 8:52 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_21-Jan-19 6:56
memberVaclav_21-Jan-19 6:56 
GeneralRe: Complex multidimensional array in C++ Pin
Richard MacCutchan21-Jan-19 22:36
protectorRichard MacCutchan21-Jan-19 22:36 
You cannot add initialisers to the struct definition, but only to actual instances of it. So it should rather be something like:
struct ILI9341 {      // definition of the struct starts here
    uint8_t index;    // tracking index
    uint8_t Command;  //
    uint8_t c_d;      // flag 0 command 1 data
    uint8_t *Data;    // data array
// data array format
// valid data count
// data...
// end marker
    char *Name;       // command name
    char *Function;   // brief function description
    uint32_t delay;   // delay in uS after command
    char *RefPage;    // ILI9341 manual reference page
    char *Notes;      // misc notes
    uint8_t* temp;    // this should be a pointer to allow for variable length entries
} ILI9341_CommandList[COMMAND_ARRAY] = 
{                         // actual instances in the array are initialised here
    {       // first entry in the structure array
        0,                // tracking index
        0,                // Command
        0,                // flag 0 command 1 data
        buffer,           // data array buffer declared elsewhere as BYTE buffer[some number]
        "command name"    // command name
        "Function",       // brief function description
        100,              // delay in uS after command
        RefPage,          // ILI9341 manual reference page
        Notes,            // misc notes
        { 0x1, 0x0, 0xFF }    // command array - you may need a counter somewhere to indicate
                              //                 how many entries are in this array
    }, // end of the first entry
    {
         // other entries up to a maximum of COMMAND_ARRAY
    }
};

And you can also fill in any of the fields later in the executable code by addressing struct entries as ILI9341_CommandList[n] where n is in the range [0..COMMAND_ARRAY-1].
AnswerRe: Complex multidimensional array in C++ Pin
k505420-Jan-19 4:54
memberk505420-Jan-19 4:54 
GeneralRe: Complex multidimensional array in C++ Pin
Vaclav_20-Jan-19 10:13
memberVaclav_20-Jan-19 10:13 
AnswerRe: Complex multidimensional array in C++ Pin
Stefan_Lang20-Jan-19 21:29
memberStefan_Lang20-Jan-19 21:29 
Questionis there any relation object states control and encapsulation? Pin
nig3D19-Jan-19 8:05
membernig3D19-Jan-19 8:05 
AnswerRe: is there any relation object states control and encapsulation? Pin
phil.o19-Jan-19 9:41
mvephil.o19-Jan-19 9:41 
AnswerRe: is there any relation object states control and encapsulation? Pin
CPallini19-Jan-19 10:34
mveCPallini19-Jan-19 10:34 
JokeRe: is there any relation object states control and encapsulation? Pin
Peter_in_278019-Jan-19 10:51
professionalPeter_in_278019-Jan-19 10:51 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D20-Jan-19 4:23
membernig3D20-Jan-19 4:23 
GeneralRe: is there any relation object states control and encapsulation? Pin
Peter_in_278020-Jan-19 10:49
professionalPeter_in_278020-Jan-19 10:49 
GeneralRe: is there any relation object states control and encapsulation? Pin
nig3D27-Jan-19 10:25
membernig3D27-Jan-19 10:25 
AnswerRe: is there any relation object states control and encapsulation? Pin
leon de boer19-Jan-19 18:47
memberleon de boer19-Jan-19 18:47 
QuestionWhat are the programmers' opinions about Plain English Programming? Pin
Quantum Robin18-Jan-19 8:04
memberQuantum Robin18-Jan-19 8:04 
QuestionRe: What are the programmers' opinions about Plain English Programming? Pin
David Crow18-Jan-19 16:21
memberDavid Crow18-Jan-19 16:21 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
leon de boer19-Jan-19 2:48
memberleon de boer19-Jan-19 2:48 
GeneralRe: What are the programmers' opinions about Plain English Programming? Pin
Stefan_Lang20-Jan-19 22:08
memberStefan_Lang20-Jan-19 22:08 
AnswerRe: What are the programmers' opinions about Plain English Programming? Pin
Alan Balkany22-Jan-19 5:45
memberAlan Balkany22-Jan-19 5:45 
QuestionHow to recognize a MutliTouch Input Event ? Pin
Member 1406801918-Jan-19 3:11
memberMember 1406801918-Jan-19 3:11 

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.