For a char [], I can easily get its length by:
char []
char a[] = \"aaaaa\"; int length = sizeof(a)/sizeof(char); // length=6
However,
You can find the length of a char* string like this:
char* mystring = "Hello World"; int length = sprintf(mystring, "%s", mystring);
sprintf() prints mystring onto itself, and returns the number of characters printed.