2

Possible Duplicate:
std::string length() and size() member functions

In my opinion size() and length() both mean the length of characters stored in the string.Is there anyting different with them.

Community
  • 1
  • 1
venus.w
  • 2,171
  • 7
  • 28
  • 42

1 Answers1

2

No. They are identical. See C++11, 21.4.4/3:

size_type length() const noexcept;

Returns: size().

Community
  • 1
  • 1
Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084