I don't want to spoon feed you since it appears you want to learn some stuff "the hard way" (congrats on that). Besides there are probably dozens of ways to do this, each with a dozen variations...
link_array itself (based on its prototype) returns a
char, but you really want a
string for the result, right? So you could return a char*, or to pass in a third (destination) char array.
Like this
Code:
char link_array(char destination[], char first[], char second[], int length)
Of course, now the parameter
length gets even more problematic than it was since it's the length of which array? You had it as a sort of, what we call, "magic number" (generally bad philosophically) fixed at MAX. But if you concatenate two MAX strings you get 2 times MAX...
You might also want to break up your link_array function some.
Create a simple (no need for it to be robust if you're just learning)
my_calc_string_length function and pass it one char array at a time and let it find the length and pass it back as a return value. You could then use the final value of
ctr (from your loop) as the length, rather than trying to do math on the addresses using the pointers (unless you really WANT to do that...)