I passed in a char* into a function and I need to find out how many characters long it is..... how do i do this?
I passed in a char* into a function and I need to find out how many characters long it is..... how do i do this?
Code:int length=lstrlen(char *);
As long as you're 100% sure that there is memory allocated for the char* and it contains a '\0', then it should work.
Code:int function(char *x) { int length = strlen(x); return length; }