InI'd write such a function, I take to expect the destinationcalling function to allocate the array and pass it and its size as an argumentarguments. That leaves the memory useallocation and disposaldeallocation up to theeach library user, who canmay want/need (for other reasons) to use a static array, borrow from the heap memory, or allocate an automatic array, as suits their purpose and allows them to de-allocate it (or not) when it istheir application no longer neededneeds it. Coding these details into your library would restrict its usability.