I thought I could do it because that's what's done in mentioned article. However that is for C and perhaps C++ is different?
Although I define Error like below my example won't compile.
struct Error {
byte code;
//boolean active;
char msg[21];
};
I know I could just list the values, but then I need to know in what order they shall appear - and that is exactly what I want to avoid. Supplying the name of the fields just makes the code easier to read and there's no risk to mix things up. My example here is very simple but the case is of course general.
Should I conclude there is no way to init a struct using its field names?