c++ string of fixed size code example
Example 1: declaring strings c++
std::string str = "hello world";
char *str = "hello world";
char str[] = "hello world";
char str[11] = "hello world";
Example 2: c++ string size
// C++ string size
str.length();
str.size(); // synonym
Example 3: c++ string size
// 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;
}