Merge two sorted arrays recursively

This is a discussion on Merge two sorted arrays recursively within the C Programming forums, part of the General Programming Boards category; Hi, the exercise is this:
I got two sorted arrays (of any length) and I got to merge them into ...

My solution seems to work well. I only got a doubt about how I solved it, it is: is there a way to make it in the form "v3 = merge(parameters);" ?
I would like to know if I can do it with returns... it would be a non-void function.

I think that will be a little awkward, actually. What you have now is very clear; if it works, just leave it that way. Why do you think using the return value would represent an improvement?

A lot of the recursive functions I've been using have returns (for example those with trees and lists management). Since I was not able to make it with returns (in this exercise), I was curious to know if the reason was behind my lack of experience or if, as you said, it is actually better to make it without returns.
If you say this is a good solution, it's ok to me xD

If you wanted to pass v3 out then you'd probably also want to avoid passing it in. Therefore you'd probably want to move the malloc inside the merge function. Then you'd probably end up making lots of malloc calls, possibly leak memory, or return a buffer that had been freed, and ultimately end up with a worse solution.
You're probably best doing it as you have now. However I suggest using better variable names as that would make it easier to follow.