`
891633093
  • 浏览: 48915 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

D开头的函数

阅读更多
函数名: ecvt
功 能: 把一个浮点数转换为字符串
用 法: char ecvt(double value, int ndigit, int *decpt, int *sign);
程序例:

#include <stdlib.h>   #include <stdio.h>   #include <conio.h>    int main(void)   {   char *string;   double value;   int dec, sign;   int ndig = 10;    clrscr();   value = 9.876;   string = ecvt(value, ndig, &dec, &sign);   printf("string = %s dec = %d sign = %d\n", string, dec, sign);    value = -123.45;   ndig= 15;   string = ecvt(value,ndig,&dec,&sign);   printf("string = %s dec = %d sign = %d\n",string, dec, sign);     value = 0.6789e5; /* scientific notation */   ndig = 5;   string = ecvt(value,ndig,&dec,&sign);   printf("string = %s dec = %d sign = %d\n", string, dec, sign);    return 0;   } 


函数名: ellipse
功 能: 画一椭圆
用 法: void far ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);
程序例:

#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;   int stangle = 0, endangle = 360;   int xradius = 100, yradius = 50;    /* 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:");   getch();   exit(1);   /* terminate with an error code */   }    midx = getmaxx() / 2;   midy = getmaxy() / 2;   setcolor(getmaxcolor());    /* draw ellipse */   ellipse(midx, midy, stangle, endangle,xradius, yradius);    /* clean up */   getch();   closegraph();   return 0;   } 


函数名: enable
功 能: 开放硬件中断
用 法: void enable(void);
程序例:

#include <stdio.h>   #include <dos.h>   #include <conio.h>    /* The clock tick interrupt */   #define INTR 0X1C    void interrupt ( *oldhandler)(void);    int count=0;    void interrupt handler(void)   {   /*   disable interrupts during the handling of the interrupt   */   disable();   /* increase the global counter */   count++;   /*   re enable interrupts at the end of the handler   */   enable();   /* call the old routine */   oldhandler();   }    int main(void)   {   /* save the old interrupt vector */   oldhandler = getvect(INTR);    /* install the new interrupt handler */   setvect(INTR, handler);    /* loop until the counter exceeds 20 */   while (count < 20)   printf("count is %d\n",count);    /* reset the old interrupt handler */   setvect(INTR, oldhandler);    return 0;   }


函数名: eof
功 能: 检测文件结束
用 法: int eof(int *handle);
程序例:

#include <sys\stat.h>   #include <string.h>   #include <stdio.h>   #include <fcntl.h>   #include <io.h>    int main(void)   {   int handle;   char msg[] = "This is a test";   char ch;    /* create a file */   handle = open("DUMMY.FIL",O_CREAT | O_RDWR,S_IREAD | S_IWRITE);    /* write some data to the file */   write(handle, msg, strlen(msg));    /* seek to the beginning of the file */   lseek(handle, 0L, SEEK_SET);    /*   reads chars from the file until hit EOF   */   do   {   read(handle, &ch, 1);   printf("%c", ch);   } while (!eof(handle));    close(handle);   return 0;   }


函数名: exec...
功 能: 装入并运行其它程序的函数
用 法:

int execl(char *pathname, char *arg0, arg1, ..., argn, NULL);   int execle(char *pathname, char *arg0, arg1, ..., argn, NULL,   char *envp[]);   int execlp(char *pathname, char *arg0, arg1, .., NULL);   int execple(char *pathname, char *arg0, arg1, ..., NULL,   char *envp[]);   int execv(char *pathname, char *argv[]);   int execve(char *pathname, char *argv[], char *envp[]);   int execvp(char *pathname, char *argv[]);   int execvpe(char *pathname, char *argv[], char *envp[]); 
程序例:

/* execv example */   #include <process.h>   #include <stdio.h>   #include <errno.h>    void main(int argc, char *argv[])   {   int i;    printf("Command line arguments:\n");   for (i=0; i<argc; i++)   printf("[%2d] : %s\n", i, argv[i]);    printf("About to exec child with arg1 arg2 ...\n");   execv("CHILD.EXE", argv);    perror("exec error");    exit(1);   }


函数名: exit
功 能: 终止程序
用 法: void exit(int status);
程序例:

#include <stdlib.h>   #include <conio.h>   #include <stdio.h>    int main(void)   {   int status;    printf("Enter either 1 or 2\n");   status = getch();   /* Sets DOS errorlevel */   exit(status - '0');    /* Note: this line is never reached */   return 0;   }


函数名: exp
功 能: 指数函数
用 法: double exp(double x);
程序例:

#include <stdio.h>   #include <math.h>    int main(void)   {   double result;   double x = 4.0;    result = exp(x);   printf("'e' raised to the power of %lf (e ^ %lf) = %lf\n",x, x, result);    return 0;   }
分享到:
评论

相关推荐

    C语言函数手册

    以首字母分类(1): A开头 B开头 C开头 D开头 E开头 F开头 G开头 H开头 I开头 K开头 L开头 以首字母分类(2): M开头 N开头 O开头 P开头 R开头 S开头 T开头 U开头 V开头 W开头 1.字符测试函数 2.字符串操作 3.内存...

    C语言函数手册HTML版

    以首字母分类(1): A开头 B开头 C开头 D开头 E开头 F开头 G开头 H开头 I开头 K开头 L开头 以首字母分类(2): M开头 N开头 O开头 P开头 R开头 S开头 T开头 U开头 V开头 W开头 1.字符测试函数 2.字符串操作 3.内存...

    C语言标准函数库 包括全部常用库函数

    C语言的标准函数库,包括以a b c d e f s t u v w等开头的全部C语言标准函数,希望对大家有帮助。

    PHP常用函数手册大全

    格式以一个%开头,以一个字母结尾,该字母决定输出的数据类型。PHP的类型说明符如表所示。 PHP的类型说明符 类型说明符 说 明 b 输出二进制整数 o 输出八进制整数 x,X 输出十六进制整数,“x”使用小写字母,“X”...

    python之函数架构-搭建房子的砖

    —定义函数以def关键词开头,后面跟着函数名、圆括号()、括号中的参数、冒号;  —接着,在缩进块中编写函数体,函数的第一行语句一般是写文档字符串,用于存放函数说明,也可以选择不写; —Return[expression]...

    串口中断服务函数集文本文件

    void delay(unsigned char d) //在源程序开头定义是否用w77e58或22。1184M晶振 {unsigned char j; do{ d--; //110592 & 89c52 #ifndef cpuw77e58 #ifndef xtal221184 j=21; //k=38 cpu80320 100us k="21" cpu ...

    Turbo C 2.0、Borland C++库函数及用例!

    字母A开头函数函数名: abort功 能: 异常终止一个进程用 法: void abort(void);程序例:#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;int main(void){printf("Calling abort()\n");abort();return 0; /* This is never ...

    webpack工具,很方便 直接导出使用

    node webpack_mixer.js -l 1.js -m 2.js -o webout.js ...为导出函数添加多个方法,类似d.e,d.m,d.n等等 -m 函数模块的js路径 函数模块的js特征: 1.一般以(window.webpackJsonp开头 -o 输入结果的js路径

    c语言库函数大全.rar(Word版本)

    函数大全(a开头) .doc 函数大全(b开头) .doc 函数大全(c开头) .doc 函数大全(d开头) .doc 函数大全(e开头) .doc

    C语言中操作密码文件的一些函数总结

    函数说明:setpwent()用来将getpwent()的读写地址指回密码文件开头。 范例 #include #include main() { struct passwd *user; int i; for(i = 0; i &lt; 4; i++) { user = getpwent(); printf(%s :%d

    C语言程序设计标准教程

    printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i--,i++,-i--); } i 这个程序与例2.13相比只是把多个printf语句改一个printf 语句输出。但从结果可以看出是不同的。为什么结果会不同呢?就是因为printf函数对输出表中各...

    elfun18:elfun18 是一组函数,可以计算各种椭圆积分和函数。-matlab开发

    在后一种情况下,函数名称以 m 开头。 不完全椭圆积分以 Jacobi 形式、Legendre 形式和 Jacobi 的第二形式(Epsilon 函数和 Lambda 函数)给出。 功能列表: 椭圆积分: - Bulirsch 的椭圆积分:cel、cel1、cel2、...

    12月C语言选择题

    C.main函数必须位于文件的开头 D.每行只能写一条语句 50102 错误的叙述是( D )。 A.一个C语言源程序可由一个或多个函数组成 B.若一条语句较长,也可分写在下一行上 C.C程序必须包含一个main()函数 D.构成C语言源...

    C++复习资料之系列

    ( c ) 可以在程序的任何地方 (d) 必须在其它函数中间 2.用C++语言编制的源程序要变为目标程序必须要经过( d )。 (a) 解释 (b) 汇编 (c) 编辑 (d) 编译 3.C++程序基本单位是( c )。 (a) 数据 (b) 字符 (c) ...

    C语言编程宝典C语言编程宝典

    《C语言编程宝典》 说明: 作者:王大刚 分为基础篇和函数篇 基础篇 1.1 Turbo C语言概述 1.2 ...函数篇 (注:字母表示函数以该字母开头。) A B C D E F G H I K L M O P Q R S T U V W 图形函数 字符屏幕函数

    c语言练习题

    A) 在C语言中,main函数必须位于文件的开头 B) C语言每行中只能写一条语句 C) C语言本身没有输入、输出语句 D) 对一个C语言进行编译预处理时,可检查宏定义的语法错误 6、 下列选项中,不能用作标识符的是( D )。 A)...

    数学算法原书光盘

    所有这些为验证上述子过程而编的验证过程按书中的章数分别放在以D开头的子目录中。 所有为验证过程而做的工程,按书中的章数分别放在以V开头的子目录中。 2、使用: 1)最简单的做法是若D盘有大于50M的空间...

    matlab计算定积分代码-stunning-tribble-MATLAB:在本练习中,您将使用黎曼和和MATLAB内置函数积分来近似计算函数

    matlab计算定积分代码惊人的tribble-MATLAB 在本练习中,您将使用黎曼和和 MATLAB 内置函数积分来近似计算函数的定积分值。 该代码接受作为输入:一个函数 ...开头的函数,格式紧凑 N=length(n); 如上所述计算向量

    C语言编程宝典.chm

    C语言编程宝典.chm ----------------------------------------------------------------------------...函数篇 (注:字母表示函数以该字母开头。) A B C D E F G H I K L M O P Q R S T U V W 图形函数 字符屏幕函数

    C语言编程宝典(chm版本)

    C语言编程宝典 作者:王大刚 ----------------------------------------------------------------...函数篇 (注:字母表示函数以该字母开头。) A B C D E F G H I K L M O P Q R S T U V W 图形函数 字符屏幕函数

Global site tag (gtag.js) - Google Analytics