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

43 lines
776 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>标准库函数 - exit</h1>
<p>原型extern void exit(int retval);</p>
<p>用法:#include &lt;stdlib.h></p>
<p>功能:结束程序</p>
<p>说明:返回值将被忽略</p>
举例:<pre><code class="language-c">
// exit.c
#include &lt;syslib.h>
#include &lt;stdlib.h>
main()
{
int i;
clrscr(); // clear screen
textmode(0x00);
for(i=0;i<10;i++)
{
if(i==5) exit(0);
else
{
clrscr();
printf("%d",i);
getchar();
}
}
getchar();
return 0;
}
</code></pre>相关函数:无