On 2 Dec 2002, Morten Welinder wrote: [...]
Unless we're talking an inner and very intensive loop, all this is a bit silly.
However, assuming that it does make sense, sprintf variants are not part of the answer. They're interpreted and var-arg type
Why would vararg be a problem performance-wise?
More like something along these lines:
char *tmpdst = dst;
strcpy (tmpdst, src1); tmpdst += strlen (src1);
[...]
This works even better when the strlen calls have known results.
Except usually src* are constant strings and it's a major pain from a maintainability and readability point of vue to have to duplicate them. And whenever src* is not a constant, the above is twice as slow as cpycat because each string is read twice (once by strcpy and another time by strlen).