I was reading the answers for this question and found that there is actually a method called length() for std::string (I always used size()>
length()
std::string
size()>
length of string ==how many bits that string having, size==size of those bits, In strings both are same if the editor allocates size of character is 1 byte