17.3 — std::string length and capacity « Learn C++

17.3 — std::string length and capacity « Learn C++

瀏覽:1134
日期:2024-05-16
Note that the capacity is higher than the length of the string! Although our string was length 8, the string actually allocated enough memory for 15 characters! Why was this done? The important thing to recognize here is that if a user wants to put more c...看更多