1 / 256
文档名称:

C语言常用函数.docx

格式:docx   大小:274KB   页数:256页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

C语言常用函数.docx

上传人:飞行的笑笑 2022/6/21 文件大小:274 KB

下载得到文件列表

C语言常用函数.docx

相关文档

文档介绍

文档介绍:C语言常用函数
C语言常用函数
C语言常用函数
- 让每一个人同等地提高自我
函数名 : abort
功 能 : 异样停止一个进度
用 法 : void abort(void);
程序例 :
#i函数
C语言常用函数
C语言常用函数
- 让每一个人同等地提高自我
函数名 : allocmem
功 能: 分派 DOS 储存段
用 法 : int allocmem(unsigned size, unsigned *seg);
程序例 :
#include <>
#include <>
#include <>
int main(void)
{
unsigned int size, segp;
int stat;
size = 64; /* (64 x 16) = 1024 bytes */
stat = allocmem(size, &segp);
if (stat == -1)
printf("Allocated memory at segment: %x\n", segp);
else
printf("Failed: maximum number of paragraphs available is %u\n",
stat);
return 0;
}
函数名 : arc
功 能: 画一弧线
用 法 : void far arc(int x, int y, int stangle, int endangle, int radius);
程序例 :
#include <>
#include <>
#include <>
#include <>
int main(void)
{
/* request auto detection */
int gdriver = DETECT , gmode, errorcode;
int midx, midy;
int stangle = 45, endangle = 135;
int radius = 100;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult(); /* an error occurred */
if (errorcode != grOk)
{
C语言常用函数
C语言常用函数
C语言常用函数
3
C语言常用函数
C语言常用函数
C语言常用函数
- 让每一个人同等地提高自我
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* draw arc */
arc(midx, midy, stangle, endangle, radius);
/* clean up */
getch();
closegraph();
return 0;
}
函数名 : asctime
功 能 : 变换日期和时间为 ASCII 码
用 法 : char *asctime(const struct tm *tblock);
程序例 :
#include <>
#include <>
#include <>
int main(void)
{
struct tm t;
char str[80];
/* sample loading of tm structure */
= 1; /* Seconds */