0
How to find the length of string in c++
No of characters... Not the size
2 Respostas
0
// string::length
#include <iostream>
#include <string>
int main ()
{
std::string str ("Test string");
std::cout << "The size of str is " << str.length() << " bytes.\n";
return 0;
}
0
int strLength;
string strName = "bsbdbdhjfgdjdjdhggff";
strLength = strlen(strName);
cout << strLength << endl;