#include <cstring>
#include <cstring>
using namespace std;
int main(void) {
char stringName[] = "This contains the content of your string";
int stringLength = strlen(stringName);
cout << "String: " << stringName << endl << "Length of String: " << stringLength << endl;
return 0;
}
#include <cstring>
strlen(str);
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char first[500];
cout<<"what is your favorite word : ";
cin>>first;
cout<<(strcat(first," Is a good choice"))<<endl;
cout<<"Size ;"<<(strlen(first));
return 0;
}
let str ="Hello World! "
console.log(str.length);
//17
// string::length
#include <iostream>
#include <string>
int main ()
{
std::string str ("Test string ");
std::cout << "The size of str is " << str.length() << " bytes.
";
return 0;
}
//The size of str is 18 bytes.