size of array of char c++ code example
Example 1: length of a char array in c
char chararray[10];
size_t len = strlen(chararray);
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;
}