I was interested in a topic I did not know much about, and had a specific question in mind. I researched and answered my own question to the best of my ability in one night of research, and I invited others to provide better answers.
My question was first closed as being based on "opinion" (all reasoning is actually based on objective criteria), and I was mildly irritated by the community response. I was hoping that instead of having my answer criticized, that better answers would be posted. It does not reflect well on anyone, when they criticize a solution, and do not offer a better alternative.
Perhaps the essential problem was merely the phrasing of the question, since a "preference" can be an "opinion" when it is not taken in specific context of desired criteria (the latter is the case for my question).
What has really annoyed me is that my question has since been deleted. It's a good question that deserves an answer. Perhaps it is possible to amend my Question and Answer so that it is not perceived to be "opinion" based.
Here is the Q/A.
Here are screenshots:
Note: there are a few minor errors in the answer as it stands. memcpy
should be used instead of mempcpy
as it is standard and likely a compiler intrinsic. And I allocate an extra byte in at least one example. The points in general stand as they are. A discussion of the choice of strscpy
to return ssize_t
instead of size_t
should also be discussed.
strcpy_s
.