You say that this is a "prefix" argument to apply to the printing.
The answer is that you should make the argument const
, stop doing whatever mutations you're doing to it inside the function, and then use ""
as a default argument:
void print(const char* prefix = "")