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

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 *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);   } 




函数名: access
功 能: 确定文件的访问权限
用 法: int access(const char *filename, int amode);
程序例:

#include <stdio.h>   #include <io.h>    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 <stdio.h>   #include <math.h>    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 <dos.h>   #include <alloc.h>   #include <stdio.h>    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 <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 = 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 <stdio.h>   #include <string.h>   #include <time.h>    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 <stdio.h>   #include <math.h>    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 <assert.h>   #include <stdio.h>   #include <stdlib.h>    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 <stdio.h>   #include <math.h>    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 <stdio.h>   #include <math.h>    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 <stdio.h>   #include <stdlib.h>    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 <stdlib.h>   #include <stdio.h>    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 <stdlib.h>   #include <stdio.h>    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 <stdlib.h>   #include <stdio.h>    int main(void)   {   long l;   char *str = "98765432";    l = atol(lstr);   printf("string = %s integer = %ld\n", str, l);   return(0);   }
分享到:
评论

相关推荐

    C语言函数大全(a开头---w开头)

    本文档包含函数大全(a开头)----------函数大全(w开头)的所有函数,希望对大家有帮助

    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 ...

    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.内存...

    PHP常用内置函数(常用)

    PHP常用内置函数 PHP常用函数手册判断一个编程语言的功能强弱,可以从他的库函数入手。一个较好的编程语言,必然有较强的...格式以一个%开头,以一个字母结尾,该字母决定输出的数据类型。PHP的类型说明符如表所示。

    Python程序设计:函数定义与调用.pptx

    IQ智商测试 任务 IQ智商测试 任务背景 本任务是完成IQ智商测试,通过读取智商测试题目,然后让用户选择正确的答案,再...函数代码块以def关键词开头,后接函数标识符名称和圆括号()。 任何传入参数和自变量必须放在圆括

    2024年C语言函数大全

    从A到W,每个字母下面都列出了相应开头的函数。这样的分类方式使得查找函数变得更加快捷。 三、语法着色 为了让代码更易读,我们为函数示例代码添加了语法着色。这意味着,在查看代码时,关键字、变量名、注释等...

    javascript函数的解释

    47.当在超链接中调用JS函数时用:(javascript:)来开头后面加函数名 48.在老的浏览器中不执行此JS:&lt;!-- //--&gt; 49.引用一个文件式的JS:&lt;script type="text/javascript" src="aaa.js"&gt;&lt;/script&gt; 50.指定在不支持脚本的...

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

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

    matlab 函数库

    汇集整理了所有的matlab函数,按照开头字母从A到Z的顺序排列,方便查询。

    C库函数大全,各种函数的详细源程序及功能介绍

    函数大全(a开头) 函数名: abort 功 能: 异常终止一个进程 用 法: void abort(void); 程序例: #include #include int main(void) { printf("Calling abort()\n"); abort(); return 0; /* This is never ...

    free pascal的函数过程大全.doc

    标识符是以字母开头的字母数字串,其长度最大为8个字符。用来表示常量、变量、类型、文件、过程、函数和程序的名字。如“pname”、“i”、“j”、“a1”就是合法的标识符;但“1a”、“#a”是非法的标识符。有一点要...

    asp 正则表达式检测http开头的函数

    ‘#################################### ‘函数:ishttp[str] ‘参数:str,待处理的字符串 ‘作者:木木 ‘日期:2007/7/12 ‘描述:检测HTTP连接地址或地址栏是否以HTTP开头 ‘示例:&lt;&#37;=ishttp...

    c语言库函数大(所有字母开头的)

    函数大全(a开头) 函数名: abort 功 能: 异常终止一个进程 用 法: void abort(void); 程序例: #include #include int main(void) { printf("Calling abort()\n"); abort(); return 0; /* This is never ...

    基于LTC1298或MCP3202 的12位AD的底层函数

    可用于C语言编写的程序,在C程序的开头先声明一个外部函数: extern unsigned int adcInput(bit chanSelect); 之后在程序便可直接调用。例如: static int pdata adiBuf_A[5]; // 静态变量 static int pdata ...

    matlab实验2

    1、编写M脚本文件,m的范围为[0,2π],步长取0.02π,计算函数y1=5e-2tsin(t),y2=5e-2tcos(t)的值,并将变量m,y1和y2放在同一矩阵的A的三行中。 2、编写一个M函数文件,实现三类字符的统计。如下的两段文章,任...

    C++复习资料之系列

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

    C函数大全,希望对你们有用

    C库函数,A开头到Z结尾的一些函数,希望对你们有用,

    MingW VC 之.a .lib .dll .def 关系

    dll -&gt; def : pexports a.dll -o &gt; a.def (这里的-o是指给函数标序号) lib -&gt; def : reimp -d a.lib lib -&gt; a: (for __cdecl functions in most case) reimp a.lib; (for __stdcall functions) MSVC: c -&gt; lib cl /...

    php数组函数序列之array_unshift() 在数组开头插入一个或多个元素

    array_unshift()定义和用法 array_unshift() 函数在数组开头插入一个或多个元素。 被加上的元素作为一个整体添加,这些元素在数组中的顺序和在参数中的顺序一样。 该函数会返回数组中元素的个数。 语法 array_...

Global site tag (gtag.js) - Google Analytics