Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It really depends on the task at hand. As a rule, std::string works well.
But if you need to work with text in utf-8, interesting nuances begin.
Using arrays for strings is an approach from the C language. It is suitable in those rare cases when you have, for example, the maximum length of a string is limited and the like. In general, if you start using arrays for strings, you'll just rewrite a poorly debugged, suboptimal, and hardly well-tested implementation of std::string all over again.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question