I had to add a semicolon and a loop90 function to @rp58's snippet. I had to make up for not having printf around. Maybe another syntax detail, forget already, trivial in any event.
Other than that, the OP's expressions were fine, the order of things in the source file were fine, the code worked... fine.
So I gots to know in what way you fixed the code, and what you thought was wrong with
printarray(thisSensor.test2);
Here's the OP's code with my fixes to its real problems:
The implication is that you fixed something, so that it prints the same now, whereas it didn't print the same before.
My point was only that there was nothing wrong except incompleteness in the OP's exposition of her problem.
I apologize if you were offended or think I was coming after you again (?), that was not my intent.
TBH I was sure (afraid) I was missing something subtle about what you did that fixed a problem that I did not see as any problem.
So my request for you to elaborate.
Without seeing the actual code that generated this error message, I am wondering if you may have had this:
Sensor.test2
Please post the code that generated the error you quote. Some of us still learn things every day, I am curious about where you really did go wrong. As you have seen, you had the expression correct in the first place.
The struct declaration has initial values for the double array.
I was somewhat surprised to see that work.
In my version of the OP's code, I made the constants in the arrays different, just so I was sure what was what.
Now googling a bit I find
When we define a struct (or class) type, we can provide a default initialization value for each member as part of the type definition. This process is called non-static member initialization, and the initialization value is called a default member initializer.
Which I def did not learn before this day. So Imma guess it's some kind of modern feature, or I am good at forgetting things.