str.size vs str.length in c++ code example Example: c++ string::length vs size // C++ string size str.length(); str.size(); // synonym