I put this code sample for fun...
Because when I test it to verify that my post sample doesn't works it is work fine...
The only difference is is that I putit in a .h .cpp files...
So I do compare with the original code.
Sorry for these troubles...
Code:
#include <vector>
class Un_rst
{
public:
std::vector<double> m_A;
double compute();
};
double Un_rst::compute()
{
Serial.println();
for (unsigned i = 0; i <= m_A.size() - 1; i++) {Serial.print("m_A: "); Serial.print(m_A[i],5);} ;
Serial.println();
};
Un_rst theRst;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);//USB
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
//
}
void loop() {
// put your main code here, to run repeatedly:
theRst.m_A={1,2,3};
theRst.compute();
}