I have a C++ function which returns a std::vector<float>.
I am interfacing with some C code.
How do I change this C++ function so that it returns some pointer to a float array, and how do I save this returned array so that I can use it in my C code?
You could save the returned temporary vector in a vector object with static storage duration.
The pointer returned from
call_foo_and_get_pointeris guaranteed to stay valid until the next call to it.