size in string c++ code example
Example 1: length of string c++
#include <iostream>
#include <string>
int main ()
{
std::string str ("Test string");
std::cout << "The size of str is " << str.length() << " bytes.\n";
return 0;
}
Example 2: c++ string size
str.length();
str.size();
Example 3: length of string in c++
str.length();
Example 4: c++ string size
#include <iostream>
#include <string>
int main ()
{
std::string str ("Test string");
std::cout << "The size of str is " << str.size() << " bytes.\n";
return 0;
}