How to initialize char[] in a struct with constexpr char[] using initializer list?

Advertisements I have a struct like: constexpr char defaultName[6] = "Hello"; struct MyStruct{ char name[6]; int val; }; Now I want to initialize the struct using initializer list as following: MyStruct structObj{defaultName, 0}; However, this doesn’t work. How do I initialize the char array in initializer using defaultName? I used MyStruct structObj{defaultName, 0}; but this… Read More How to initialize char[] in a struct with constexpr char[] using initializer list?