uTools-Manuals/docs/c/strlen.html

34 lines
606 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>字符串函数 - strlen</h1>
<p>原型extern int strlen(char *s);</p>
<p>用法:#include &lt;string.h></p>
<p>功能计算字符串s的长度</p>
<p>说明返回s的长度不包括结束符NULL。</p>
举例:<pre><code class="language-c">
// strlen.c
#include &lt;syslib.h>
#include &lt;string.h>
main()
{
char *s="Golden Global View";
clrscr();
printf("%s has %d chars",s,strlen(s));
getchar();
return 0;
}
</code></pre>相关函数:无