If you're asking for (free) help, common courtesy would suggest that you post your actual code (or an abbreviated) version so that members don't waste time fixing errors that aren't part of your problem.
Regarding initialization ... most efficient would be an initializer list in the constructor:
#define SIZE 5
class Obj {
public:
Obj() : member ( {
0, 1, 2, 3, 4
}) {};
uint8_t getVal(uint8_t pos);
private:
std::array <uint8_t, SIZE> member;
};
uint8_t Obj::getVal(uint8_t pos) {
return member[pos];
}
Obj myObj;
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println();
for (size_t i = 0; i < SIZE; i++) {
Serial.println(myObj.getVal(i));
}
}
void loop() {
}