The export keyword causes functions to be exported with the C ABI for other programming languages to call into.
A C function cannot return a value of array type (though it can return structures containing arrays).
My recommendation is:
if your function must be called from other programming languages, pass as parameters the size and the pointer to a preallocated array by the caller.
if your function must be called only from zig donβt use a DLL.
I need to call the DLL from other programming languages and I am trying to find a way to return values other than integers.
Perhaps the simplest way would be to convert the array to a null-terminated string, with values separated by a |. This would allow me to process the return value and reconstruct the array in the other language.
You can return a pointer to anything (including an array).
It is important to decide who owns the memory, the memory owner must have a way to free the memory.