string length characters in c++ code example
Example 1: length of string in c++
str.length();
Example 2: c++ length of char*
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char *str = "ABC";
cout << strlen(str) << endl;
return 0;
}