In the C++ question Is it safe to use operator [] for std::string, the OP is asking for a way to pass a std::string
into a function that takes a char*
. There is a comment on the question which reads:
Why not use
s.c_str()
?
That's a very easy mistake to make, and is not a valid proposal. However, the comment has 3 upvotes (like I said, easy mistake), which might make it misleading to future readers. There are subsequent comments that indicate that this is invalid, and the commenter himself agreed.
Question is: would it be reasonable to flag this comment as not constructive? In a literal sense, the suggestion is not constructive to answering the question - but I've been using this flag more for off-topic snark. (Side-question: maybe we should just allow downvoting comments?)