4 ms·
Not sure why you're being downvoted. That's all pretty standard. Method 1 is a contract you often make as part of defining the interface. For an example, such
by jmts 8y ago
Not sure why you're being downvoted. That's all pretty standard.
Method 1 is a contract you often make as part of defining the interface. For an example, such things are out of scope so this is a perfectly reasonable point.
Method 2 is common. Most of the strn*() and snprintf() etc, do this. This is the preferred method for some of my colleagues.
Method 3 is used in the standard library, though as mentioned is usually avoided.