Let's say I have the following std::array
#define MAX_SIZE(6)
typedef struct MyStruct
{
int test_integer;
float test_float;
} MyStruct_T
std::array<MyStruct_T, MAX_SIZE> my_array = { 0 }
Now there is a function that accepts C style array by address:
void MyFunction(MyStruct_T const (&input)[MAX_SIZE])
What is the right way to pass my_array
to MyFunction
?
If the function declaration/definition argument cannot be changed, what is the most efficient way to convert std::array
to C style array? (I only see C style to std::array
methods)