搜尋此網誌

2012年8月2日 星期四

Return number of ASCii string

int
strlen(
    IN const char * s
)
/*++
Routine Description:
  This function returns the number of ASCii characters in the ASCii string s.
 Arguments: 
  Str     - Pointer to the null-terminated string to get length            str will hold the trimmed string. 
Returns:
--*/

{
const char *sc;

for (sc = s; *sc != '\0'; ++sc)
/* nothing */;
return (int)((unsigned long long)sc - (unsigned long long)s);
}

沒有留言:

張貼留言