can change length of string in c++ code example
Example 1: length of string in c++
str.length();
Example 2: create a string of length c++
#include <string>
#include <iostream>
int main()
{
std::string s(21, '*');
std::cout << s << std::endl;
return 0;
}