How to return an array from a function?
You can't. You can return a pointer though. Or better yet, use a std::vector. You can return a std::vector.