c语言A 100 开头地址,C语言库函数_-_A开头
C语言函数 - A开头
函数名: abort
功 能: 异常终止一个进程
用 法: void abort(void);
程序例:
#include
#include
int main(void)
{
printf("Calling abort()\n");
abort();
return 0; /* This is never reached */
}
函数名: abs
功 能: 求整数的绝对值
用 法: int abs(int i);
程序例:
#include
#include
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 *buffer);
程序例:
/* absread example */
#include
#include
#include
#include
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);
}
函数名: access
功 能: 确定文件的访问权限
用 法: int access(const char *filename, int amode);
程序例:
#include
#include
int file_exists(char *filename);
int main(void)
{
printf("Does NOTEXIST.FIL exist: %s\n",
file_exists("NOTEXISTS.FIL") ? "YES" : "NO");
return 0;
}
int file_exists(char *filename)
{
return (access(filename, 0) == 0);
}
函数名: acos
功 能: 反余弦函数
用 法: double acos(double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 0.5;
result = acos(x);
printf("The arc cosine of %lf is %lf\n", x, result);
return 0;
}
函数名: 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)
{
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 */
t.tm_sec = 1; /* Seconds */
t.tm_min = 30; /* Minutes */
t.tm_hour = 9; /* Hour */
t.tm_mday = 22; /* Day of the Month */
t.tm_mon = 11; /* Month */
t.tm_year = 56; /* Year - does not include century */
t.tm_wday = 4; /* Day of the week */
t.tm_yday = 0; /* Does not show in asctime */
t.tm_isdst = 0; /* Is Daylight SavTime; does not show in asctime */
/* converts structure to null terminated
string */
strcpy(str, asctime(&t));
printf("%s\n", str);
return 0;
}
函数名: asin
功 能: 反正弦函数
用 法: double asin(double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 0.5;
result = asin(x);
printf("The arc sin of %lf is %lf\n", x, result);
return(0);
}
函数名: assert
功 能: 测试一个条件并可能使程序终止
用 法: void assert(int test);
程序例:
#include
#include
#include
struct ITEM {
int key;
int value;
};
/* add item to list, make sure list is not null */
void additem(struct ITEM *itemptr) {
assert(itemptr != NULL);
/* add item to list */
}
int main(void)
{
additem(NULL);
return 0;
}
函数名: atan
功 能: 反正切函数
用 法: double atan(double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 0.5;
result = atan(x);
printf("The arc tangent of %lf is %lf\n", x, result);
return(0);
}
函数名: atan2
功 能: 计算Y/X的反正切值
用 法: double atan2(double y, double x);
程序例:
#include
#include
int main(void)
{
double result;
double x = 90.0, y = 45.0;
result = atan2(y, x);
printf("The arc tangent ratio of %lf is %lf\n", (y / x), result);
return 0;
}
函数名: atexit
功 能: 注册终止函数
用 法: int atexit(atexit_t func);
程序例:
#include
#include
void exit_fn1(void)
{
printf("Exit function #1 called\n");
}
void exit_fn2(void)
{
printf("Exit function #2 called\n");
}
int main(void)
{
/* post exit function #1 */
atexit(exit_fn1);
/* post exit function #2 */
atexit(exit_fn2);
return 0;
}
函数名: atof
功 能: 把字符串转换成浮点数
用 法: double atof(const char *nptr);
程序例:
#include
#include
int main(void)
{
float f;
char *str = "12345.67";
f = atof(str);
printf("string = %s float = %f\n", str, f);
return 0;
}
函数名: atoi
功 能: 把字符串转换成长整型数
用 法: int atoi(const char *nptr);
程序例:
#include
#include
int main(void)
{
int n;
char *str = "12345.67";
n = atoi(str);
printf("string = %s integer = %d\n", str, n);
return 0;
}
函数名: atol
功 能: 把字符串转换成长整型数
用 法: long atol(const char *nptr);
程序例:
#include
#include
int main(void)
{
long l;
char *str = "98765432";
l = atol(lstr);
printf("string = %s integer = %ld\n", str, l);
return(0);
}
c语言A 100 开头地址,C语言库函数_-_A开头相关推荐
- 51单片机c语言编程100,51单片机C语言编程100例.doc
51单片机C语言编程100例.doc 目 录实例3用单片机控制第一个灯亮3实例4用单片机控制一个灯闪烁认识单片机的工作频率3实例5将 P1口状态分别送入P0.P2.P3口认识I/O口的引脚功能4实例6 ...
- C语言第一个字节地址,C语言字节对齐详解
#pragma pack () /*取消指定对齐,恢复缺省对齐*/本文引用地址:http://www.eepw.com.cn/article/148849.htm sizeof(struct D)值为 ...
- c语言输出数字1-100,c语言输出100以内素数 c语言编程输出1到100之间素数并求和,在线等,急?...
C语言,编写函数判断一个整数是否为素数,在主函数中调用该函数并输出100以内的全部素数? 参考代码: #include <stdio.h> int is_prime_numbe ...
- C语言对函数取地址,C语言函数名以及取地址的区别和联系
有时看到如下的代码: /*****************************/ #include #include #include void test() { printf("123 ...
- c语言买100个苹果,c语言错误: 阳阳买苹果,每个苹果0.8元,第一天他买2个,第二天开始每天买前一天的2倍,直到购买的苹果...
满意答案 dk_seven 2013.04.25 采纳率:46% 等级:12 已帮助:7673人 #include void main() { int day=1,num,t=0,i=2; do ...
- 51单片机c语言试题及答案,单片机C语言期末考试题..
单片机C语言期末考试题..,单片机的c语言应用程序设计,单片机c语言编程,51单片机c语言程序100例,单片机c语言,单片机c语言编程思想,c语言开发单片机,c语言单片机程序,新概念51单片机c语言教 ...
- c语言 swap交换函数_C语言经典100题(14)
1 上期答案揭晓 首先给大家看看上一篇文章C语言经典100题(13)中第三部分编程题的答案: #includeint main(){ int i,x,y,z; for(i=100;i<1000; ...
- 完数c++语言程序_C语言经典100题(19)
1 上期答案揭晓 首先给大家看看上一篇文章C语言经典100题(18)中第三部分编程题的答案: #includeint main(){ int s=0,a,n,t; printf("请输入 a ...
- 51单片机C语言程序100例分析(1)IO+C语言+头文件
51单片机C语言程序100例分析(1)IO+C语言+头文件 \\\插播一条:文章末尾有惊喜哟~/// P1=0xfe;//P1=11111110B,即P1.0输出低电平} 分析:通过这短短的几行代码 ...
- c语言中的值传递和地址传递参数,c语言值传递,地址传递,引用传递
c语言值传递,地址传递,引用传递 总结:对于函数来说,值传递就是一个人来了,给你一些数 据,你对数据处理.地址传递就是你通过地址找到一个人,然后直接对这个人处理.而引用传递就是你要直接对一个人进行处 ...
最新文章
- P1160 队列安排
- asp.net UrlRewrite 技术的实现
- Python自动化3.0-------学习之路-------函数!
- Python学习笔记(六)if判断语句
- 今天是星期四,不知道是不是由于太想家了,每天晚上做梦遇到家人
- linux脚本实现复制,Shell脚本实现复制文件到多台服务器的代码分享
- SQL SERVER中强制类型转换cast和convert的区别
- Canvas的基本用法
- Shell.FlyoutHeaderTemplate
- swap使用率达到100%的解决办法
- python-devel找不到,可以试试python-dev
- 面向对象的软件开发方法
- 基于激光刻划技术的石墨烯器件
- 如何在云服务器上自动运行.py文件
- [C语言]PTA 念数字
- MSF Risk Management Discipline
- 软科2018大学计算机,2018中国大学排名新发:软科2018中国大学排名结果
- Cointelegraph| 安全多方计算对早期隐私格局的影响
- 隐藏input文本框的边框
- 从键盘读取一个数字,判断是否是3和5的倍数
热门文章
- (转)最近100年全球最顶尖公司的共性
- Julia: reduce 、mapreduce、filter
- 弹性计算 Region 化部署和跨可用区容灾介绍
- 机器学习笔记(十五):人脸识别
- 陈绪:3月21日阿里云北京峰会专场出品人
- 400电话查询php,PHP 匹配电话,手机,400号码 函数 及正则。很管用。
- 【TWVRP】基于matlab遗传算法求解带时间窗的含充电站车辆路径规划问题【含Matlab源码 1177期】
- 【TWVRP】基于matlab蚁群算法求解带时间窗的车辆路径规划问题【含Matlab源码 921期】
- 【细胞分割】基于matlab GUI生物细胞计数【含Matlab源码 758期】
- 【风电功率预测】基于matlab BP神经网络风电功率预测【含Matlab源码 399期】