c语言函数名称大全,C语言函数大全
C语言函数大全
更新时间:2017/2/22 18:37:00 浏览量:582 手机版
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 */
}
c语言函数名称大全,C语言函数大全相关推荐
- 通过函数名称字符串发起调用/函数名反射
python 在 python 当中,一切都是对象.函数也是第一等公民. 如果要使用函数名称字符串发起调用,目标在于通过字符串找到函数对象. 函数 def func(a):print("gl ...
- c语言memcpy是什么,C语言memcpy函数的用法
介绍 memcpy是memory copy的缩写,意为内存复制,在写C语言程序的时候,我们常常会用到它.它的函原型如下: void *memcpy(void *dest, const void *sr ...
- php7 捕获语法错误,PHP7 method_exists未捕获错误:函数名称必须是字符串
这是由于处理间接变量和方法的评估顺序为 incompatible changes: Changes to the handling of indirect variables, properties, ...
- C++ 笔记(13)— 函数(函数声明、函数定义、函数调用[传值、指针、引用]、函数参数默认值、函数重载)
每个 C++ 程序都至少有一个函数,即主函数 main() ,所有简单的程序都可以定义其他额外的函数. 1. 函数声明 函数声明告诉编译器函数的名称.返回类型和参数.函数声明包括以下几个部分: ret ...
- .net一个函数要用另一个函数的值_MATLAB中的神经网络工具箱(2)函数命令及模型搭建...
前面介绍了神经网络工具箱GUI的使用,它功能强大可以直接生成脚本.但是函数命令的灵活性是GUI所不及的.也应该有所了解. 神经网络函数命令 1.网络创建函数 函数名称 功能 fitnet 创建函数拟合 ...
- 16.JavaScript函数、return陷阱、函数定义、参数传递、默认参数、局部变量、全局变量、返回值、技巧
文章目录 函数 函数的定义 局部变量 外部变量 内外变量重名 参数 参数默认值 年长代码的默认参数 空值合并运算符的应用 返回值 return陷阱 小技巧 函数 在编程过程中,我们经常需要在很多地方使 ...
- 【玩转云函数】腾讯云函数 Python 依赖安装
以下内容来自「玩转腾讯云」用户原创文章,已获得授权. 本次作者主要是想利用腾讯云的 Serverless 云函数服务,由于腾讯云函数 Python 的环境只配置了基础的 Python 库, 比如流行的 ...
- c语言s开头的函数以及作用,C语言函数大全-s开头-完整版.doc
C语言函数大全-s开头-完整版 C语言函数大全(s开头) 函数名: sbrk 功能: 改变数据段空间位置 用法: char *sbrk(int incr); 程序例: #include#include ...
- R语言使用caret包构建岭回归模型(Ridge Regression )构建回归模型、通过method参数指定算法名称、通过trainControl函数控制训练过程
R语言使用caret包构建岭回归模型(Ridge Regression )构建回归模型.通过method参数指定算法名称.通过trainControl函数控制训练过程 目录
- R语言使用reshape2包的melt函数将dataframe从宽表到长表(Wide- to long-format)、指定行标识符变量、并自定义生成的长表的标识符列的名称
R语言使用reshape2包的melt函数将dataframe从宽表到长表(Wide- to long-format).指定行标识符变量.并自定义生成的长表的标识符列的名称 目录
最新文章
- k8s启动Pod遇到CrashLoopBackOff的解决方法
- Asp.net mvc中的Ajax处理
- SimGAN-Captcha代码阅读与复现
- 【例题+习题】【数值计算方法复习】【湘潭大学】(五)
- pythons实现信号分帧
- 《跑跑卡丁车》国内运营商裁员超30%
- rootfs文件系统的制作(一)
- 台积电南京12寸厂址 落脚江北新区
- 云播 Android,云播放(Air Playit)android版
- IE首页被劫持,桌面图标异常的个人综合清理方法
- Windows 10 创建 删除 合并磁盘分区
- 可视化GDP动态图表EXCEL也能搞定,如何用Excel做动态图表
- 课下作业(选做)第十周
- Unity2D 简易2D地图 —— 地图的显示
- 数字电路的74HC138的PROTUES的仿真
- element表格固定表头
- 计算机主机是什么系统吗,电脑RAM和ROM的区别是什么?RAM和ROM有哪些作用?
- 数论概论 第五章 习题解答(上)(宋二娃的BLOG)
- 拦截器和过滤器的概念和区别
- Elastic Job 从单点到高可用、同城主备、同城双活
热门文章
- python语言程序设计教程赵璐电子版_python语言程序设计教程 赵璐pdf 相关实例(示例源码)下载 - 好例子网...
- 数据存储之SwiftJSON
- Nginx源码安装(CentOS7)
- 65nm工艺下MOM电容详解与蒙特卡洛仿真及calibre xRC
- vpp flowprobe
- Tomcat的Document base ……does not exist or is not a readable directory错误
- fm核武破解 java出错_java.lang.UnsupportedClassVersionError 错误的原因
- Gurobi软件求解线性规划问题(卜算学习记录)
- 测试手机是否可以安装MRP软件和MRP游戏
- 云计算机平台搭建,搭建云计算平台的步骤