Check out example codes for "strlen in cpp". It will help you in understanding the concepts better.

Code Example 1

#include <cstring>
#include <iostream>

using namespace std;

int main()
{
    char str1[] = "This a string";
    
    int len1 = strlen(str1);

    cout << "Length of str1 = " << len1 << endl;

    return 0;
}

Learn ReactJs, React Native from akashmittal.com