Define a function that will accept an array of pointers to strings as an argument and return a pointer to a string that contains all the strings joined into a single a string, each terminated by a newline character. If an original string in the input array has newline as its last character, the function shouldn’t add another to the string. Write a program to demonstrate this function in operation by reading a number of strings from the keyboard and outputting the resultant combined string.
Solución sin funciones:
Solución con funciones:
Ampliación a cuando el número de strings sea arbitrario (a pointers de pointers):