pre{
line-height:1;
color:#1e1e1e;
background-color:#f0f0f0;
font-size:16px;}.sysFunc{color:#627cf6;font-style:italic;font-weight:bold;}
.selfFuc{color:#800080;}
.bool{color:#d2576f;}
.condition{color:#000080;font-weight:bold;}
.key{color:#000080;}
.var{color:#800000;font-style:italic;}
.Digit{color:#ff00ff;font-weight:bold;}
.includePre{color:#1e1e1e;}
.operator {color:#008000;font-weight:bold;}

函数名: 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); 

  

本文使用 书画小说软件 发布,内容与软件无关,书画小说软件 更惬意的读、更舒心的写、更轻松的发布。

 

A.xml的更多相关文章

  1. XStream将java对象转换为xml时,对象字段中的下划线“_”,转换后变成了两个的解决办法

            在前几天的一个项目中,由于数据库字段的命名原因 其中有两项:一项叫做"市场价格"一项叫做"商店价格" 为了便于区分,遂分别将其命名为market ...

  2. .NET Core采用的全新配置系统[9]: 为什么针对XML的支持不够好?如何改进?

    物理文件是我们最常用到的原始配置的载体,最佳的配置文件格式主要由三种,它们分别是JSON.XML和INI,对应的配置源类型分别是JsonConfigurationSource.XmlConfigura ...

  3. WebApi接口 - 响应输出xml和json

    格式化数据这东西,主要看需要的运用场景,今天和大家分享的是webapi格式化数据,这里面的例子主要是输出json和xml的格式数据,测试用例很接近实际常用情况:希望大家喜欢,也希望各位多多扫码支持和点 ...

  4. XML技术之DOM4J解析器

    由于DOM技术的解析,存在很多缺陷,比如内存溢出,解析速度慢等问题,所以就出现了DOM4J解析技术,DOM4J技术的出现大大改进了DOM解析技术的缺陷. 使用DOM4J技术解析XML文件的步骤? pu ...

  5. UWP开发之Mvvmlight实践六:MissingMetadataException解决办法(.Net Native下Default.rd.xml配置问题)

    最近完成一款UWP应用,在手机端测试发布版(Release)的时候应用莫名奇妙的强行关闭,而同样的应用包在PC端一点问题都没有,而且Debug版在两个平台都没有问题,唯独手机的Release版有问题. ...

  6. PHP中遍历XML之SimpleXML

    简单来讲述一些XML吧,XML是可扩展标记语言,是一种用于标记电子文件使其具有结构性的标记语言.XML是当今用于传输数据的两大工具之一,另外一个是json. 我们在PHP中使用XML也是用来传输数据, ...

  7. Asp.Net 操作XML文件的增删改查 利用GridView

    不废话,直接上如何利用Asp.NET操作XML文件,并对其属性进行修改,刚开始的时候,是打算使用JS来控制生成XML文件的,但是最后却是无法创建文件,读取文件则没有使用了 index.aspx 文件 ...

  8. Mybatis XML配置

    Mybatis常用带有禁用缓存的XML配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ...

  9. Drawable实战解析:Android XML shape 标签使用详解(apk瘦身,减少内存好帮手)

    Android XML shape 标签使用详解   一个android开发者肯定懂得使用 xml 定义一个 Drawable,比如定义一个 rect 或者 circle 作为一个 View 的背景. ...

  10. C#反序列化XML异常:在 XML文档(0, 0)中有一个错误“缺少根元素”

    Q: 在反序列化 Xml 字符串为 Xml 对象时,抛出如下异常. 即在 XML文档(0, 0)中有一个错误:缺少根元素. A: 首先看下代码: StringBuilder sb = new Stri ...

随机推荐

  1. SQL中的Null深入研究分析

    SQL中的Null深入研究分析 虽然熟练掌握SQL的人对于Null不会有什么疑问,但总结得很全的文章还是很难找,看到一篇英文版的, 感觉还不错. Tony Hoare 在1965年发明了 null 引 ...

  2. code manager tools TotoiseSVN安装及使用

    TotoiseSVN安装及使用 TotoiseSVN官方下载地址:http://tortoisesvn.net/downloads.html TotoiseSVN安装:很简单,一路直下:就不在这说了, ...

  3. C# 文本文件打印类库(C#)

    我写了一个打印文本文件的类库,功能包括:打印预览.打印.打印时可以选择打印机,可以指定页码范围.调用方法非常简单:TextFilePrinter p = new TextFilePrinter(tbx ...

  4. iPhone 屏幕上的 Home 键在哪里?(已解决)

    「问」:iPhone屏幕上的Home键如何开启? 「答」:在[设置]-[通用]-[辅助功能]-[AssistiveTouch],打开即可.不需要下载什么App. [Settings] - [Gener ...

  5. SGU 385 Highlander(期望)

    题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=385 题意: 思路: double f[N][N][N],g[N][N],A[N][ ...

  6. Hadoop集群(第10期副刊)_常用MySQL数据库命令

    1.系统管理 1.1 连接MySQL 格式: mysql -h主机地址 -u用户名 -p用户密码 举例: 例1:连接到本机上的MySQL. 首先在打开DOS窗口,然后进入目录 mysqlbin,再键入 ...

  7. java中final关键字

    一.final修饰方法 禁止任何继承类修改它的定义,保证在继承中使方法行为保持不闲并且不会被覆盖. final修饰的方法,同意编译器针对该方法的调用转为内嵌调用.(类似c++ 中的inline?) p ...

  8. JavaScript 高级篇之闭包、模拟类,继承(五)

    本篇主要分享我对闭包的理解及使用闭包完成私有属性.模拟类.继承等,结合大量例子,希望大家能快速掌握!首先让我们先从一些基本的术语开始吧     一.javascript中的闭包 1.我们一起先来理解什 ...

  9. ArrayAdapter参数的不同运用

    ArrayAdapter参数不同带来的效果不同 String[] array = {"a","b","c","d",&q ...

  10. UVa 247 Calling Circles【传递闭包】

    题意:给出n个人的m次电话,问最后构成多少个环,找出所有的环 自己想的是:用map来储存人名,每个人名映射成一个数字编号,再用并查集,求出有多少块连通块,输出 可是map不熟,写不出来,而且用并查集输 ...