I figured it out. To return an array you need to write your function as so

int *foo() {}

I can switch it from a template to int and just use some function overloading if its required.

I fixed errors and realized how to do it. Admin could you please delete this post?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.