Click here to Skip to main content
13,704,934 members

C / C++ / MFC

 
AnswerRe: Inter Process Communication between C++ - C# Pin
jschell14-Apr-18 5:48
memberjschell14-Apr-18 5:48 
QuestionHow cin.get() works in loop ? Pin
Tarun Jha7-Apr-18 3:32
memberTarun Jha7-Apr-18 3:32 
SuggestionRe: How cin.get() works in loop ? Pin
David Crow7-Apr-18 6:34
memberDavid Crow7-Apr-18 6:34 
AnswerRe: How cin.get() works in loop ? Pin
Richard MacCutchan7-Apr-18 20:55
protectorRichard 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
memberjfbode10291-Jun-18 12:16 
QuestionCListCtrl with group view enabled and long subtitles Pin
Friedbert Widmann5-Apr-18 22:43
memberFriedbert 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
memberarnold_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?

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.

AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Richard MacCutchan5-Apr-18 23:26
protectorRichard MacCutchan5-Apr-18 23:26 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 0:31
memberarnold_w6-Apr-18 0:31 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt6-Apr-18 0:55
mvpJochen Arndt6-Apr-18 0:55 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 1:30
memberarnold_w6-Apr-18 1:30 
AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt5-Apr-18 23:36
mvpJochen Arndt5-Apr-18 23:36 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 0:32
memberarnold_w6-Apr-18 0:32 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt6-Apr-18 1:13
mvpJochen Arndt6-Apr-18 1:13 
AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Joe Woodbury6-Apr-18 6:06
professionalJoe Woodbury6-Apr-18 6:06 
Questionwhy ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
Tarun Jha3-Apr-18 7:53
memberTarun Jha3-Apr-18 7:53 
AnswerRe: why ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
Victor Nijegorodov3-Apr-18 9:03
memberVictor Nijegorodov3-Apr-18 9:03 
AnswerRe: why ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
David Crow3-Apr-18 10:41
memberDavid Crow3-Apr-18 10:41 
AnswerRe: why ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
leon de boer3-Apr-18 13:48
memberleon de boer3-Apr-18 13:48 
QuestionHelp compiling OpenCV Pin
_Flaviu2-Apr-18 23:25
member_Flaviu2-Apr-18 23:25 
AnswerRe: Help compiling OpenCV Pin
Victor Nijegorodov3-Apr-18 2:04
memberVictor Nijegorodov3-Apr-18 2:04 
GeneralRe: Help compiling OpenCV Pin
_Flaviu3-Apr-18 2:08
member_Flaviu3-Apr-18 2:08 
GeneralRe: Help compiling OpenCV Pin
_Flaviu3-Apr-18 2:08
member_Flaviu3-Apr-18 2:08 
GeneralRe: Help compiling OpenCV Pin
Victor Nijegorodov3-Apr-18 4:08
memberVictor Nijegorodov3-Apr-18 4:08 

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.


Advertise | Privacy | Cookies | Terms of Service
Web05-2016 | 2.8.180920.1 | Last Updated 22 Sep 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid