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. SSIS -->> Variable Data Type vs SSIS Data Type

    变量和参数的数据类型一致,只是参数比变量少了诸如object这种可选类型.和SSIS数据类型的映射关系

  2. 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...

  3. java获取当前月第一天和最后一天,上个月第一天和最后一天

    package com.test.packager; import java.text.ParseException; import java.text.SimpleDateFormat; impor ...

  4. php去除数组中重复数据

    <?php /** * 去除数组中重复数据 * by www.jbxue.com **/ $input = array("a" => "green" ...

  5. Mtk Android 打包解包*.img

    打包/解包 boot.img, system.img, userdata.img, or recovery.img [DESCRIPTION] MTK codebase编译出来的image必须使用MT ...

  6. 【Todo】各种排序整理

    今天面试别人,问到堆排序.发现自己都记不太清楚了. 堆排序 从小到大排序,要用到的是,最大堆. 过程是最大堆,堆顶的最大的元素,调换到数组最后,依次进行.最后达到从小到大的效果. 归并排序 可以看这个 ...

  7. (转)UILabel的详细使用

    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 75, 40)];   //初始化UIlbel并设定frame lab ...

  8. VIM Ctrl-V Conflict with Windows Paste

    /************************************************************************************** * VIM Ctrl-V ...

  9. java多线程模拟停车系统

    import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent ...

  10. Hive 中函数总结

    Hive supports three types of conditional functions. These functions are listed below: IF( Test Condi ...