Click here to Skip to main content
15,905,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to use constructor list passing an array Pin
Vaclav_20-Apr-18 11:25
Vaclav_20-Apr-18 11:25 
Questionlinking issue Pin
tasumisra16-Apr-18 6:51
tasumisra16-Apr-18 6:51 
AnswerRe: linking issue Pin
Victor Nijegorodov16-Apr-18 21:39
Victor Nijegorodov16-Apr-18 21:39 
AnswerRe: linking issue Pin
Richard MacCutchan17-Apr-18 0:33
mveRichard MacCutchan17-Apr-18 0:33 
QuestionHow to write more that ONE data byte into ioctl file? Pin
Vaclav_11-Apr-18 14:47
Vaclav_11-Apr-18 14:47 
AnswerRe: How to write more that ONE data byte into ioctl file? Pin
Richard MacCutchan11-Apr-18 21:26
mveRichard MacCutchan11-Apr-18 21:26 
AnswerRe: How to write more that ONE data byte into ioctl file? Pin
Victor Nijegorodov11-Apr-18 22:06
Victor Nijegorodov11-Apr-18 22:06 
AnswerRe: How to write more that ONE data byte into ioctl file? Pin
Jochen Arndt11-Apr-18 22:18
professionalJochen Arndt11-Apr-18 22:18 
GeneralRe: How to write more that ONE data byte into ioctl file? Pin
Vaclav_12-Apr-18 3:57
Vaclav_12-Apr-18 3:57 
Questionapp is not running in debug mode Pin
Member 83893869-Apr-18 20:39
Member 83893869-Apr-18 20:39 
AnswerRe: app is not running in debug mode Pin
Maciej Los9-Apr-18 21:01
mveMaciej Los9-Apr-18 21:01 
AnswerRe: app is not running in debug mode Pin
Victor Nijegorodov9-Apr-18 22:46
Victor Nijegorodov9-Apr-18 22:46 
GeneralRe: app is not running in debug mode Pin
Member 83893869-Apr-18 23:14
Member 83893869-Apr-18 23:14 
GeneralRe: app is not running in debug mode Pin
Victor Nijegorodov10-Apr-18 1:03
Victor Nijegorodov10-Apr-18 1:03 
QuestionInter Process Communication between C++ - C# Pin
ptr_Electron8-Apr-18 18:13
ptr_Electron8-Apr-18 18:13 
AnswerRe: Inter Process Communication between C++ - C# Pin
Jochen Arndt8-Apr-18 21:26
professionalJochen Arndt8-Apr-18 21:26 
AnswerRe: Inter Process Communication between C++ - C# Pin
Randor 9-Apr-18 10:03
professional Randor 9-Apr-18 10:03 
AnswerRe: Inter Process Communication between C++ - C# Pin
jschell14-Apr-18 5:48
jschell14-Apr-18 5:48 
QuestionHow cin.get() works in loop ? Pin
Tarun Jha7-Apr-18 3:32
Tarun Jha7-Apr-18 3:32 
SuggestionRe: How cin.get() works in loop ? Pin
David Crow7-Apr-18 6:34
David Crow7-Apr-18 6:34 
AnswerRe: How cin.get() works in loop ? Pin
Richard MacCutchan7-Apr-18 20:55
mveRichard MacCutchan7-Apr-18 20:55 
AnswerRe: How cin.get() works in loop ? Pin
Peter_in_27808-Apr-18 21:13
professionalPeter_in_27808-Apr-18 21:13 
AnswerRe: How cin.get() works in loop ? Pin
jfbode10291-Jun-18 12:16
jfbode10291-Jun-18 12:16 
QuestionCListCtrl with group view enabled and long subtitles Pin
Friedbert Widmann5-Apr-18 22:43
Friedbert Widmann5-Apr-18 22:43 
QuestionHow can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w5-Apr-18 21:46
arnold_w5-Apr-18 21:46 
How can I do this in a smarter way in regular C-programming, without having an init function that initializes the values?

C++
struct myStruct_s {
    int myInt;
    Bool_t myBool;
    EventCallback_t myEventCallback;
};

#define DESIRED_ARRAY_SIZE    (5)

static struct myStruct_s myArray[] = {
#if 1 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 2 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 3 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 4 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 5 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 6 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 7 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 8 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 9 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 10 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 11 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 12 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 13 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 14 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 15 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 16 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 17 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 18 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 19 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
#if 20 <= DESIRED_ARRAY_SIZE
    {0xABCD, TRUE, NULL},
#endif
};


modified 6-Apr-18 7:29am.

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.