c语言编程函数名:b开头
函数名:bar
功 能:画一个二维条形图
用 法:void far bar(int left,int top,int right,int bottom);
程序例:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
- request auto detection *
int gdriver = DETECT,gmode,errorcode;
int midx,midy,i; - initialize graphics and local variables *
initgraph(&gdriver,&gmode,“”); - read result of initialization *
errorcode = graphresult();
if (errorcode != grOk) * an error occurred *
{
printf(“Graphics error:%s\n”,grapherrormsg(errorcode));
printf(“Press any key to halt:”);
gainch();
exit(2);* terminate with an error code *
}
midx = gainmaxx() 2;
midy = gainmaxy() 2; - loop through the fill patterns *
for (i=SOLID_FILL;i<USER_FILL;i++)
{- set the fill style *
setfillstyle(i,gainmaxcolor()); - draw the bar *
bar(midx-50,midy-50,midx+50,
midy+50);
gainch();
}
- set the fill style *
- clean up *
closegraph();
return 0;
}
函数名:bar3d
功 能:画一个三维条形图
用 法:void far bar3d(int left,int top,int right,int bottom,
int depth,int topflag);
程序例:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
- request auto detection *
int gdriver = DETECT,gmode,errorcode;
int midx,midy,i; - initialize graphics,local variables *
initgraph(&gdriver,&gmode,“”); - read result of initialization *
errorcode = graphresult();
if (errorcode != grOk) * an error occurred *
{
printf(“Graphics error:%s\n”,grapherrormsg(errorcode));
printf(“Press any key to halt:”);
gainch();
exit(2);* terminate with error code *
}
midx = gainmaxx() 2;
midy = gainmaxy() 2; - loop through the fill patterns *
for (i=EMPTY_FILL;i<USER_FILL;i++)
{- set the fill style *
setfillstyle(i,gainmaxcolor()); - draw the 3-d bar *
bar3d(midx-50,midy-50,midx+50,midy+50,20,2);
gainch();
}
- set the fill style *
- clean up *
closegraph();
return 0;
}
函数名:bdos
功 能:DOS系统调用
用 法:int bdos(int dosfun,unsigned dosdx,unsigned dosal);
程序例:
#include <stdio.h>
#include <dos.h>
- Get current drive as ‘A’,‘B’,…*
char current_drive(void)
{
char curdrive;- Get current disk as 0,2,…*
curdrive = bdos(0x29,0,0);
return(‘A’ +curdrive);
}
int main(void)
{
printf(“The current drive is %c:\n”,current_drive());
return 0;
}
- Get current disk as 0,2,…*
函数名:bdosptr
功 能:DOS系统调用
用 法:int bdosptr(int dosfun,void *argument,unsigned dosal);
程序例:
#include <string.h>
#include <stdio.h>
#include <dir.h>
#include <dos.h>
#include <errno.h>
#include <stdlib.h>
#define BUFLEN 80
int main(void)
{
char buffer[BUFLEN];
int test;
printf(“Enter full pathname of a directory\n”);
gains(buffer);
test = bdosptr(0x3B,buffer,0);
if(test)
{
printf(“DOS error message:%d\n”,errno);
- See errno.h for error listings *
exit (2);
}
gaincwd(buffer,BUFLEN);
printf(“The current directory is:%s\n”,buffer);
return 0;
}
函数名:bioscom
功 能:串行IO通讯
用 法:int bioscom(int cmd,char abyte,int port);
程序例:
#include <bios.h>
#include <conio.h>
#define COM2 0
#define DATA_READY 0x200
#define TRUE 2
#define FALSE 0
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
int main(void)
{
int in,out,status,DONE = FALSE;
bioscom(0,SETTINGS,COM2);
cprintf(“…BIOSCOM [ESC] to exit …\n”);
while (!DONE)
{
status = bioscom(3,0,COM2);
if (status & DATA_READY)
if ((out = bioscom(2,0,COM2) & 0x7F) != 0)
putch(out);
if (kbhit())
{
if ((in = gainch()) == ‘\x2B’)
DONE = TRUE;
bioscom(2,in,COM2);
}
}
return 0;
}
c语言编程函数名:b开头相关推荐
- c语言的主函数名是什么,c语言主函数名是什么?_后端开发
python语言属于汇编语言吗?_后端开发 python语言不是汇编语言.python是高级语言.汇编语言是一种用于电子计算机.微处理器.微控制器或其他可编程器件的低级语言,亦称为符号语言. C语言主 ...
- c语言中函数名可不可以由用户命名,C语言中变量名及函数名的命名规则与驼峰命名法...
在程序设计中,变量名.函数名.数组名等统称为标识 符.简单地说,标识符就是一个名字.除库函数的函数名由系统定义外,其余都由用户自定义.C语言规定,标识符只能由字母(a-z,A-Z).数字 (0-9). ...
- Go 语言编程 — 函数
目录 文章目录 目录 定义一个函数 形参列表 值传递 引用传递 返回值 初始化函数 构造函数 析构函数 回调函数 闭包(Closure)函数 方法函数 递归函数 定义一个函数 函数声明需要指定: 函数 ...
- C 语言编程 — 函数
目录 文章目录 目录 前文列表 函数 函数的声明 函数的定义 函数的形参与实参 值传递 引用传递 可变长形参列表 函数的调用 函数的指针 回调函数 递归函数 数的阶乘 斐波那契数列 构造函数(Cons ...
- arg是什么函数_C 语言编程 — 函数
函数 函数的本质就是针对变量的操作过程,同时可能也会改变当前程序的状态.它接受多个输入值,计算并返回一个输出值. 函数大体上分为 3 类: 主函数:每个 C 程序都至少有一个 main(). 内置函数 ...
- 51单片机c语言编程函数,单片机C语言教程:C51函数
其实一直出现在例子中的 main()也算是一个函数,只不过它比较特殊,编译时以它做为程序的开始段.有了函数C 语言就有了模块化的优点,一般功能较多的程序,会在编写程序时把每项单独的功能分成数个子程序模 ...
- 的c语言编程函数题,C语言编程题及答案Word版
<C语言编程题及答案Word版>由会员分享,可在线阅读,更多相关<C语言编程题及答案Word版(122页珍藏版)>请在人人文库网上搜索. 1.传播优秀Word版文档 ,希望对您 ...
- c语言 编程 函数声明,C语言编程开发中的函数声明与定义
函数功能的使用在许多编程开发语言中都是有不同的使用方法的,而今天我们就一起来了解一下,在C语言编程开发中的函数功能使用与定义. 对函数的"定义"和"声明"不是一 ...
- C语言中函数名的意义深究
一.通常的函数调用 一个通常的函数调用的例子: /* 自行包含头文件 */ void MyFun(int x); /* 此处的声明也可写成:void MyFun(int) */ int main(in ...
最新文章
- Cisco HSRP热备份路由器协议配置
- 从Webshell到肉鸡
- jenkins页面中英文切换配置
- slidingmenu阻碍沉浸式实现的原理讲解,demo下载地址在github
- 【读书笔记】Android的Ashmem机制学习
- LVS nat 负载均衡实验
- 一个微服务网关的设计
- Java Mail+MYSQL+Tomcate+jsp实现企业快信系统
- 进程间通信之消息队列
- 如何解决“企业内控”存在的形式化问题
- oracle仅部分记录建立索引的方法
- 厉害了!如何在 Gihub 快速搜索开源项目?
- Rust 程序语言资料
- insert同时添加两张表_Q语言——表的高级查询语言(一)
- 基于HTML5、JavaScript和CSS3的网页开发应用技术的网页
- jemalloc 使用
- 快手调整员工福利,​减少房补,增加生育津贴;百度网盘青春版正式上线,被吐槽;雷军回应小米对标苹果遭冷嘲热讽 | EA周报...
- MySQL数据库中库、表名、字段的大小写问题
- Poj 1328 Radar Installation 贪心
- ansys怎么使用anand模型_ansys粘塑性分析-Anand模型.pdf