Hi, very new to C.

I have a project that requires me to input a string into a rail fence cipher, I have created a function and passed the string to it, created a 2d array and then printed off the coded text but this is within the function and read straight from the array.

How do I allocate the output of the array to a string then pass that from the function back to main?

thanks in advance for any help.