A little about the basic question, but it's hard for me to find a definitive answer.
Does the initializer list the only way to initialize class fields in C ++, except for assignment in methods?
If I use the wrong terminology, here is what I mean:
class Test { public: Test(): MyField(47) { }
EDIT : in particular, is there a good way to initialize a struct field using a structure initializer? For example:
struct MyStruct { int Number, const char* Text }; MyStruct struct1 = {};
c ++ initialization ctor-initializer
Roman starkov
source share