Let's say I have following declaration in the C++:
struct Configuration {
struct ParametersSetA {
float param_A_01;
float param_A_02;
float param_A_03;
} parameters_set_A;
struct ParametersSetB {
float param_B_01;
float param_B_02;
} parameters_set_B;
};
Then somewhere in the code I have following definition:
Configuration config = {
.parameters_set_A = {
.param_A_01 = 1.0f,
.param_A_02 = 2.0f,
.param_A_03 = param_A_01 + param_A_02;
},
.parameters_set_B = {
.param_B_01 = 0.50f,
.param_B_02 = 0.75f
}
};
My question is whether the initialization (especially as far as the param_A_03 item in the nested struct ParametersSetA)
I have used above is correct in the C++?
param_A_01->config.parameters_set_A.param_A_01and similar for the other. And the semicolon after that line doesn't belong there either.param_A_01 + param_A_02when initializingparam_A_03.