Suppose I have 4 variables:
float f0 = 0.1;
float f1 = 1.2;
float f2 = 2.3;
float f3 = 3.4;
Is there a way I can write a macro to access these variables without eventually writing them? Basically I need something like this:
float sum = 0;
for(int i = 0; i < 4; i++) sum += MACRO(i);
cout<<sum<<endl;
//OUTPUT: 7.0
1