- 1
Length of the string
3 Respostas
+ 2
string a="hi there";
cout<< a.length();
//output 8
+ 2
You can use .length() or .size().
cout << “hi”.length();
And
cout << “hi”.size();
Will both output 2. I prefer size() because it requires less typing and seems to do the same thing.
+ 1
Can you specify with more detail please.