how to get the length of a cstring c++ code example
Example: c++ length of char*
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char *str = "ABC";
cout << strlen(str) << endl;
return 0;
}
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char *str = "ABC";
cout << strlen(str) << endl;
return 0;
}