uTools-Manuals/docs/c/putchar.html

43 lines
829 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>输入输出 - putchar</h1>
<p>原型extern void putchar(char c);</p>
<p>用法:#include &lt;stdio.h></p>
<p>功能在屏幕上显示字符c</p>
<p>说明:字符输出在屏幕的当前位置。</p>
可用move或gotoxy改变光标位置。
举例:<pre><code class="language-c">
// putchar.c
#include &lt;stdio.h>
#include &lt;system.h>
#define CPR 14
main()
{
int i,j,k;
clrscr();
textmode(0x00);
for(i=1;i<6;i++)
{
k=i>3?(6-i):i;
move(i,CPR/2-k);
for(j=1;j&lt;k*2;j++) putchar('*');
}
gotoxy(10,10); // Hide Cursor
getchar();
return 0;
}
</code></pre>相关函数:无