Quote Originally Posted by MK27 View Post
I guess. I would say that for allocation, too much is better than too little, but that is not true for iterative reads, so not very good advice. Seems to me that once I read the analogy (you need 11, not 10 fenceposts for a 100' fence with posts every 10 feet) it was easier to conceive of and notice.
I find your analogy off for your own example. While this can be, indeed, the cause for off-by-one errors, it's not for the copying of strings. That is not caused by forgetting to add one after subtraction, but rather by forgetting to count \0 as a character that has to be stored as well. Still an off by one error, but different analogy.