Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: std::string length() および size() メンバー関数
私の意見では、 size() と length() はどちらも、文字列に格納されている文字の長さを意味します。何か違いがありますか。
いいえ、同じです。C++11、21.4.4/3 を参照してください。
size_type length() const noexcept; 戻り値: size().
size_type length() const noexcept;
戻り値: size().
size()