Explanatory Question
Difference between length() and capacity() string functions?
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.