Let the following example code:
char s1[] = "Hey there #!";
char s2[] = "Lou";
I would like to write a function which replaces the '#' with the value of s2. Also it allocates memory dynamically for a new output string which has the new replaced version. Is it possible in an elegant and non-complicated way, using mostly built-in functions? I'm aware of how to replace characters with a character in a string or strings with a given substring but this one seems to beat me.