mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-03-07 14:30:37 +08:00
0.0.1
This commit is contained in:
42
docs/c/exit.html
Normal file
42
docs/c/exit.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<h1>标准库函数 - exit</h1>
|
||||
|
||||
|
||||
<p>原型:extern void exit(int retval);</p>
|
||||
|
||||
<p>用法:#include <stdlib.h></p>
|
||||
|
||||
<p>功能:结束程序</p>
|
||||
|
||||
<p>说明:返回值将被忽略</p>
|
||||
|
||||
举例:<pre>
|
||||
|
||||
// exit.c
|
||||
|
||||
#include <syslib.h>
|
||||
#include <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;
|
||||
}
|
||||
|
||||
</pre>相关函数:无
|
||||
|
||||
Reference in New Issue
Block a user