get string len cpp code example
Example 1: length of string in c++
str.length();
Example 2: length of a string c++
string str ="hello world";
//different ways to find length of a string:
str.length();
str.size();
Example 3: string length c++
// string::length
#include <iostream>
#include <string>
int main ()
{
std::string str ("Test string");
std::cout << "The size of str is " << str.length() << " bytes.\n";
return 0;
}