uTools-Manuals/docs/c/toupper.html
2019-04-21 11:50:48 +08:00

30 lines
746 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>字符函数 - toupper</h1>
<p>原型extern int toupper(int c);</p>
<p>用法:#include &lt;ctype.h></p>
<p>功能将字符c转换为大写英文字母</p>
<p>说明如果c为小写英文字母则返回对应的大写字母否则返回原来的值。</p>
举例:
<pre><code class="language-c">
// toupper.c
#include &lt;syslib.h>
#include &lt;ctype.h>
main()
{
char *s="Hello, World!";
int i;
clrscr(); // clear screen
printf("%s\n",s);
for(i=0;i&lt;strlen(s);i++)
{
putchar(toupper(s[i]));
}
getchar();
return 0;
}
</code></pre>
相关函数:<a href="tolower.html">tolower</a>