A function to handle multiple datatypes

PaulS:

He probably expects to send the strings without terminating zeros.

foo1 and foo2 have terminating NULLs.

char nonsense[4] = { 'c', 'r', 'a', 'p' };

does not.

Yes, I am very well aware that foo1 and foo2 have terminating nulls and that char nonsense[4] in your example doesn't. Instead of writing "He probably expects to send the strings without terminating zeros.", I perhaps should have written "When he sends strings, he probably doesn't want to send the terminating zeros."

PaulS:
Though why one would want to do this is unclear. The definition of a string is "a NULL terminated array of chars", so your premise is flawed from the start.

My premise wasn't flawed. My premise was that when he sends null terminating char arrays a.k.a strings, he probably wants to send the non-null characters only and not the terminating nulls. I am not sure if thats what the OP wanted, but it certainly is a valid assumption. And that is something that was not possible with Nick's templated sendAnytihing().