String concatenation for Serial.print

Delta_G:
Not bad depending on what you're going for. Convenience or code size. I'd like to remind that the OP in this case was concerned with code size and efficiency. So your answer may be right in some scenarios but is a loser at the metric requested.

Yes, although 'code size and efficiency' is somewhat dependant on requirements; simple debug output is one thing, formatting several lines for an LCD is another.

e.g. I have a project which needs no text output, apart from debug, and is at the point where sprintf() won't fit, so I (obviously) like my mini-printf function because it avoids the overhead in both RAM/ROM of using sprintf(), agrees with my (unreasonable?) loathing of streaming operators, is identical in timing to multiple Serial.print()'s but has the overhead of the function itself (but thereafter is more ROM 'efficient' than multiple calls of Serial.print) which I live with for the convenience.

Now, if 'efficiency' included 'neatness', 'readability' or 'convenience'... there'd be more points of view than programmers :slight_smile:

Yours,
TonyWilk