Struct return in Library

Hi, we are currently programming a library and need to return an int array in a function. For that we created a struct in our first test code, which worked fine. But now we want to implement this in our library and we are not sure where to put the struct definition. So basically:

struct testStruct someFunction(){ }

Can anyone help us?


Wrapping an array in an struct is not the best way to return an array from a function. If the array is statically sized in the struct, the caller should create the array, and pass a reference to it to the function that needs to populate it.

So, why are you wrapping the array in a struct?

If you must, define the struct in a header file, included in the library and the sketch.