mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 23:14:06 +08:00
37 lines
822 B
HTML
37 lines
822 B
HTML
<h1>字符函数 - tolower</h1>
|
||
|
||
|
||
<p>原型:extern int tolower(int c);</p>
|
||
|
||
<p>用法:#include <ctype.h></p>
|
||
|
||
<p>功能:将字符c转换为小写英文字母</p>
|
||
|
||
<p>说明:如果c为大写英文字母,则返回对应的小写字母;否则返回原来的值。</p>
|
||
|
||
举例:<pre><code class="language-c">
|
||
|
||
// tolower.c
|
||
|
||
#include <syslib.h>
|
||
#include <ctype.h>
|
||
|
||
main()
|
||
{
|
||
char *s="Hello, World!";
|
||
int i;
|
||
|
||
clrscr(); // clear screen
|
||
printf("%s\n",s);
|
||
for(i=0;i<strlen(s);i++)
|
||
{
|
||
putchar(tolower(s[i]));
|
||
}
|
||
|
||
getchar();
|
||
return 0;
|
||
}
|
||
|
||
</code></pre>相关函数:<a href="toupper.html">toupper</a>
|
||
|