how to find the size of a string in c++ code example
Example 1: length of string in c++
str.length();
Example 2: c++ string size
str.length();
str.size();
Example 3: how to get string length in c++
#include <iostream>
#include <string>
int main()
{
string str = "iftee";
int len = str.length();
cout << "The String Length: " << len << endl;
int len2 = str.size();
cout << "The String Length: " << len2 << endl;
return 0;
}
Example 4: length of a string c++
string str ="hello world";
str.length();
str.size();