- 博客(0)
- 资源 (4)
- 收藏
- 关注
C语言标准函数库 函数名 功能 用法 程序例
A
函数名: abort
功 能: 异常终止一个进程
用 法: void abort(void);
程序例:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Calling abort()\n");
abort();
return 0; /* This is never reached */
}
函数名: abs
功 能: 求整数的绝对值
用 法: int abs(int i);
程序例:
#include <stdio.h>
#include <math.h>
int main(void)
{
int number = -1234;
printf("number: %d absolute value: %d\n", number,
abs(number));
return 0;
}
函数名: absread, abswirte
功 能: 绝对磁盘扇区读、写数据
用 法: int absread(int drive, int nsects, int sectno, void
*buffer);
int abswrite(int drive, int nsects, in tsectno, void
2
*buffer);
程序例:
/* absread example */
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <dos.h>
int main(void)
{
int i, strt, ch_out, sector;
char buf[512];
printf("Insert a diskette into drive A and press any
key\n");
getch();
sector = 0;
if (absread(0, 1, sector, &buf) != 0)
{
perror("Disk problem");
exit(1);
}
printf("Read OK\n");
strt = 3;
for (i=0; i<80; i++)
{
ch_out = buf[strt+i];
putchar(ch_out);
}
printf("\n");
return(0);
}
2010-11-17
dosbook 简单实用的命令
DOS系统的安装
恢复误删文件
合并VCD片断、快速删除文件夹
低格、分区、高格的应对--DOS命令
清除CMOS密码--DOS命令
一劳永逸--批处理命令
2010-11-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人