| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> C yu yan ku han shu (A lei zi mu )

C yu yan ku han shu (A lei zi mu )

2008-06-01 02:10:48 编辑來源:互联网 评论
 
 
 
本文为【C语言库函数 (A类字母)】的拼音翻译版
  [ fa biao ri qi :2002-1-4 9:28:46 ]
  han shu ming : abort
  gong neng : yi chang zhong zhi yi ge jin cheng
  yong fa : void abort(void);
  cheng xu li :
  #include <stdio.h>
  #include <stdlib.h>
  int main(void)
  {
  printf("Calling abort()\n");
  abort();
  return 0; /* This is never reached */
  }
  han shu ming : abs
  gong neng : qiu zheng shu de jue dui zhi
  yong fa : int abs(int i);
  cheng xu li :
  #include <stdio.h>
  #include <math.h>
  int main(void)
  {
  int number = -1234;
  printf("number: %d absolute value: %d\n", number, abs(number));
  return 0;
  }
  han shu ming : absread, abswirte
  gong neng : jue dui ci pan shan qu du 、 xie shu ju
  yong fa : int absread(int drive, int nsects, int sectno, void *buffer);
  int abswrite(int drive, int nsects, in tsectno, void *buffer);
  cheng xu li :
  /* 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);
  }
  han shu ming : Access
  gong neng : que ding wen jian de fang wen quan xian
  yong fa : int access(const char *filename, int amode);
  cheng xu li :
  #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);
  }
  han shu ming : acos
  gong neng : fan yu xian han shu
  yong fa : double acos(double x);
  cheng xu li :
  #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;
  }
  han shu ming : allocmem
  gong neng : fen pei DOS cun chu duan
  yong fa : int allocmem(unsigned size, unsigned *seg);
  cheng xu li :
  #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;
  }
  han shu ming : arc
  gong neng : hua yi hu xian
  yong fa : void far arc(int x, int y, int stangle, int endangle, int radius);
  cheng xu li :
  #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;
  }
  han shu ming : asctime
  gong neng : zhuan huan ri qi he shi jian wei ASCII ma
  yong fa : char *asctime(const strUCt tm *tblock);
  cheng xu li :
  #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;
  }
  han shu ming : asin
  gong neng : fan zheng xian han shu
  yong fa : double asin(double x);
  cheng xu li :
  #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);
  }
  han shu ming : assert
  gong neng : ce shi yi ge tiao jian bing ke neng shi cheng xu zhong zhi
  yong fa : void assert(int test);
  cheng xu li :
  #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;
  }
  han shu ming : atan
  gong neng : fan zheng qie han shu
  yong fa : double atan(double x);
  cheng xu li :
  #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);
  }
  han shu ming : atan2
  
   gong neng : ji suan Y/X de fan zheng qie zhi
  yong fa : double atan2(double y, double x);
  cheng xu li :
  #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;
  }
  han shu ming : atexit
  gong neng : zhu ce zhong zhi han shu
  yong fa : int atexit(atexit_t func);
  cheng xu li :
  #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;
  }
  han shu ming : atof
  gong neng : ba zi fu chuan zhuan huan cheng fu dian shu
  yong fa : double atof(const char *nptr);
  cheng xu li :
  #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;
  }
  han shu ming : atoi
  gong neng : ba zi fu chuan zhuan huan cheng chang zheng xing shu
  yong fa : int atoi(const char *nptr);
  cheng xu li :
  #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;
  }
  han shu ming : atol
  gong neng : ba zi fu chuan zhuan huan cheng chang zheng xing shu
  yong fa : long atol(const char *nptr);
  cheng xu li :
  #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);
  }【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
[ fa biao ri qi :2002-1-4 9:28:46 ] han shu ming : abort gong neng : yi chang zhong zhi yi ge jin cheng yong fa : void abort(void); cheng xu li : #include <stdio.h> #include <stdlib.h> int main(void) { printf("Calling abort()\n"); abort(); return 0; /* This is never reached */ } han shu ming : abs gong neng : qiu zheng shu de jue dui zhi yong fa : int abs(int i); cheng xu li : #include <stdio.h> #include <math.h> int main(void) { int number = -1234; printf("number: %d absolute value: %d\n", number, abs(number)); return 0; } han shu ming : absread, abswirte gong neng : jue dui ci pan shan qu du 、 xie shu ju yong fa : int absread(int drive, int nsects, int sectno, void *buffer); int abswrite(int drive, int nsects, in tsectno, void *buffer); cheng xu li : /* 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); } han shu ming : Access gong neng : que ding wen jian de fang wen quan xian yong fa : int access(const char *filename, int amode); cheng xu li : #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); } han shu ming : acos gong neng : fan yu xian han shu yong fa : double acos(double x); cheng xu li : #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; } han shu ming : allocmem gong neng : fen pei DOS cun chu duan yong fa : int allocmem(unsigned size, unsigned *seg); cheng xu li : #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; } han shu ming : arc gong neng : hua yi hu xian yong fa : void far arc(int x, int y, int stangle, int endangle, int radius); cheng xu li : #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; } han shu ming : asctime gong neng : zhuan huan ri qi he shi jian wei ASCII ma yong fa : char *asctime(const strUCt tm *tblock); cheng xu li : #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; } han shu ming : asin gong neng : fan zheng xian han shu yong fa : double asin(double x); cheng xu li : #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); } han shu ming : assert gong neng : ce shi yi ge tiao jian bing ke neng shi cheng xu zhong zhi yong fa : void assert(int test); cheng xu li : #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; } han shu ming : atan gong neng : fan zheng qie han shu yong fa : double atan(double x); cheng xu li : #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); } han shu ming : atan2 gong neng : ji suan Y/X de fan zheng qie zhi yong fa : double atan2(double y, double x); cheng xu li : #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; } han shu ming : atexit gong neng : zhu ce zhong zhi han shu yong fa : int atexit(atexit_t func); cheng xu li : #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; } han shu ming : atof gong neng : ba zi fu chuan zhuan huan cheng fu dian shu yong fa : double atof(const char *nptr); cheng xu li : #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; } han shu ming : atoi gong neng : ba zi fu chuan zhuan huan cheng chang zheng xing shu yong fa : int atoi(const char *nptr); cheng xu li : #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; } han shu ming : atol gong neng : ba zi fu chuan zhuan huan cheng chang zheng xing shu yong fa : long atol(const char *nptr); cheng xu li : #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); }
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
赏心悦目的模特儿(9)
赏心悦目的模特儿(8)
赏心悦目的模特儿(7)
赏心悦目的模特儿(6)
周六一日游--绿野翠蜂场(一)
骆驼峰
下一站上环
杂乱的几张Danang
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有