> > It's really inefficient: the cost increases quadratically with the size > > of the resulting string. > > Well, no, the cost is linear. It would only be quadratic if the number > of strcat calls depended on the length of the string. > > > It's more efficient to do: > > > > sprintf(foo, "%s%s%s%s%s%s", bar1,bar2,bar3,bar4,bar5,bar6); >
While I agree with Alexandre that the argument for this change based on efficiency is not compelling, I find the resulting clarity of code refreshing. And perhaps it's not our top priority, but I think if we can encourage folks to tighten the code, that would be a Good Thing (TM).