Click here to Skip to main content
15,848,904 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Struct initalization valid ? Pin
markkuk7-Nov-23 12:48
markkuk7-Nov-23 12:48 
GeneralRe: Struct initalization valid ? Pin
Maximilien8-Nov-23 3:32
Maximilien8-Nov-23 3:32 
GeneralRe: Struct initalization valid ? Pin
CPallini8-Nov-23 3:37
mveCPallini8-Nov-23 3:37 
AnswerRe: Struct initalization valid ? Pin
jschell8-Nov-23 7:01
jschell8-Nov-23 7:01 
AnswerRe: Struct initalization valid ? Pin
honey the codewitch8-Nov-23 11:03
mvahoney the codewitch8-Nov-23 11:03 
GeneralRe: Struct initalization valid ? Pin
k50548-Nov-23 13:31
mvek50548-Nov-23 13:31 
GeneralRe: Struct initalization valid ? Pin
honey the codewitch8-Nov-23 22:31
mvahoney the codewitch8-Nov-23 22:31 
GeneralRe: Struct initalization valid ? Pin
k50549-Nov-23 5:12
mvek50549-Nov-23 5:12 
You do need to use -Wextra to get those warnings:
Shell
[k5054@localhost]$ cat example.cpp 
#include <iostream>

struct S
{
    int i;
    float f;
    double d;
};

int main()
{
    S  s{0};

    std::cout << s.f << '\n';
}
[k5054@localhost]$ g++ example.cpp
[k5054@localhost]$ g++ example.cpp -Wall
[k5054@localhost]$ g++ example.cpp -Wextra
example.cpp: In function ‘int main()’:
example.cpp:12:11: warning: missing initializer for member ‘S::f’ [-Wmissing-field-initializers]
   12 |     S  s{0};
      |           ^
example.cpp:12:11: warning: missing initializer for member ‘S::d’ [-Wmissing-field-initializers]
[k5054@localhost]$ 
Keep Calm and Carry On

GeneralRe: Struct initalization valid ? Pin
honey the codewitch9-Nov-23 5:51
mvahoney the codewitch9-Nov-23 5:51 
GeneralRe: Struct initalization valid ? Pin
k50549-Nov-23 7:49
mvek50549-Nov-23 7:49 
GeneralNot a question, just a lament about metaprogramming Pin
honey the codewitch28-Oct-23 23:19
mvahoney the codewitch28-Oct-23 23:19 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell8-Nov-23 7:06
jschell8-Nov-23 7:06 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch8-Nov-23 7:07
mvahoney the codewitch8-Nov-23 7:07 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell9-Nov-23 8:03
jschell9-Nov-23 8:03 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch9-Nov-23 8:10
mvahoney the codewitch9-Nov-23 8:10 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell10-Nov-23 6:23
jschell10-Nov-23 6:23 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch10-Nov-23 6:37
mvahoney the codewitch10-Nov-23 6:37 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch8-Nov-23 7:17
mvahoney the codewitch8-Nov-23 7:17 
QuestionHow to extract all words - using regular expression Pin
Salvatore Terress26-Oct-23 7:35
Salvatore Terress26-Oct-23 7:35 
AnswerRe: How to extract all words - using regular expression Pin
k505426-Oct-23 8:21
mvek505426-Oct-23 8:21 
AnswerRe: How to extract all words - using regular expression Pin
Richard Andrew x6426-Oct-23 9:51
professionalRichard Andrew x6426-Oct-23 9:51 
AnswerRe: How to extract all words - using regular expression Pin
Richard MacCutchan26-Oct-23 23:16
mveRichard MacCutchan26-Oct-23 23:16 
GeneralRe: How to extract all words - using regular expression Pin
Salvatore Terress27-Oct-23 11:21
Salvatore Terress27-Oct-23 11:21 
GeneralRe: How to extract all words - using regular expression Pin
Richard MacCutchan27-Oct-23 23:13
mveRichard MacCutchan27-Oct-23 23:13 
AnswerRe: How to extract all words - using regular expression Pin
jschell27-Oct-23 11:11
jschell27-Oct-23 11: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.