L.xml

pre{
border:1px
solid?#000;line-height:1;
color:#800016;
background-color:#e9ffff;
font-size:16px;}.sysFunc{color:#566d68;font-style:italic;font-weight:bold;}
.selfFuc{color:#f3e191;}
.bool{color:#f6ac77;}
.condition{color:#ff00ff;font-weight:bold;}
.key{color:#c1018f;}
.var{color:#4e00ff;font-style:italic;}
.Digit{color:#000080;font-weight:bold;}
.includePre{color:#160080;}
.operator?{color:#008000;font-weight:bold;}

函数名:?labs?

功??能:?取长整型绝对值?

用??法:?long?labs(long?n);?

程序例:?

#include?<stdio.h>?
#include?<math.h>?
int?main(void)?
{?
???long?result;?
???long?x?=?-12345678L;?
???result=?labs(x);?
???printf("number:?%ld?abs?value:?%ld\n",?
??????x,?result);?
???return?0;?
}?
??
??
??

函数名:?ldexp?

功??能:?计算value*2的幂?

用??法:?double?ldexp(double?value,?int?exp);?

程序例:?

#include?<stdio.h>?
#include?<math.h>?
int?main(void)?
{?
???double?value;?
???double?x?=?2;?
???/*?ldexp?raises?2?by?a?power?of?3?
??????then?multiplies?the?result?by?2???*/?
???value?=?ldexp(x,3);?
???printf("The?ldexp?value?is:?%lf\n",?
??????value);?
???return?0;?
}?
??
??

函数名:?ldiv?

功??能:?两个长整型数相除,?返回商和余数?

用??法:?ldiv_t?ldiv(long?lnumer,?long?ldenom);?

程序例:?

/*?ldiv?example?*/?
#include?<stdlib.h>?
#include?<stdio.h>?
int?main(void)?
{?
???ldiv_t?lx;?
???lx?=?ldiv(100000L,?30000L);?
???printf("100000?div?30000?=?%ld?remainder?%ld\n",?lx.quot,?lx.rem);?
???return?0;?
}?
??
??
??

函数名:?lfind?

功??能:?执行线性搜索?

用??法:?void?*lfind(void?*key,?void?*base,?int?*nelem,?int?width,?

??????int?(*fcmp)());?

程序例:?

#include?<stdio.h>?
#include?<stdlib.h>?
int?compare(int?*x,?int?*y)?
{?
???return(?*x?-?*y?);?
}?
int?main(void)?
{?
???int?array[5]?=?{35,?87,?46,?99,?12};?
???size_t?nelem?=?5;?
???int?key;?
???int?*result;?
???key?=?99;?
???result?=?lfind(&key,?array,?&nelem,?
????????sizeof(int),?(int(*)(const?void?*,const?void?*))compare);?
???if?(result)?
??????printf("Number?%d?found\n",key);?
???else?
??????printf("Number?%d?not?found\n",key);?
???return?0;?
}?
??
??

函数名:?line?

功??能:?在指定两点间画一直线?

用??法:?void?far?line(int?x0,?int?y0,?int?x1,?int?y1);?

程序例:?

#include?<graphics.h>?
#include?<stdlib.h>?
#include?<stdio.h>?
#include?<conio.h>?
int?main(void)?
{?
???/*?request?auto?detection?*/?
???int?gdriver?=?DETECT,?gmode,?errorcode;?
???int?xmax,?ymax;?
???/*?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);?
???}?
???setcolor(getmaxcolor());?
???xmax?=?getmaxx();?
???ymax?=?getmaxy();?
???/*?draw?a?diagonal?line?*/?
???line(0,?0,?xmax,?ymax);?
???/*?clean?up?*/?
???getch();?
???closegraph();?
???return?0;?
}?
??
??

函数名:?linerel?

功??能:?从当前位置点(CP)到与CP有一给定相对距离的点画一直线?

用??法:?void?far?linerel(int?dx,?int?dy);?

程序例:?

#include?<graphics.h>?
#include?<stdlib.h>?
#include?<stdio.h>?
#include?<conio.h>?
int?main(void)?
{?
???/*?request?auto?detection?*/?
???int?gdriver?=?DETECT,?gmode,?errorcode;?
???char?msg[80];?
???/*?initialize?graphics?and?local?variables?*/?
???initgraph(&gdriver,?&gmode,?"");?
???/*?read?result?of?initialization?*/?
???errorcode?=?graphresult();?
???if?(errorcode?!=?grOk)?
???{?
??????printf("Graphics?error:?%s\n",?
??grapherrormsg(errorcode));?
??????printf("Press?any?key?to?halt:");?
??????getch();?
??????exit(1);?
???}?
???/*?move?the?C.P.?to?location?(20,?30)?*/?
???moveto(20,?30);?
???/*?create?and?output?a?
??????message?at?(20,?30)?*/?
???sprintf(msg,?"?(%d,?%d)",?getx(),?gety());?
???outtextxy(20,?30,?msg);?
???/*?draw?a?line?to?a?point?a?relative?
??????distance?away?from?the?current?
??????value?of?C.P.???*/?
???linerel(100,?100);?
???/*?create?and?output?a?message?at?C.P.?*/?
???sprintf(msg,?"?(%d,?%d)",?getx(),?gety());?
???outtext(msg);?
???/*?clean?up?*/?
???getch();?
???closegraph();?
???return?0;?
}?
??

函数名:?localtime?

功??能:?把日期和时间转变为结构?

用??法:?struct?tm?*localtime(long?*clock);?

程序例:?

#include?<time.h>?
#include?<stdio.h>?
#include?<dos.h>?
int?main(void)?
{?
???time_t?timer;?
???struct?tm?*tblock;?
???/*?gets?time?of?day?*/?
???timer?=?time(NULL);?
???/*?converts?date/time?to?a?structure?*/?
???tblock?=?localtime(&timer);?
???printf("Local?time?is:?%s",?asctime(tblock));?
???return?0;?
}?
??
??
??

函数名:?lock?

功??能:?设置文件共享锁?

用??法:?int?lock(int?handle,?long?offset,?long?length);?

程序例:?

#include?<io.h>?
#include?<fcntl.h>?
#include?<sys\stat.h>?
#include?<process.h>?
#include?<share.h>?
#include?<stdio.h>?
int?main(void)?
{?
???int?handle,?status;?
???long?length;?
???/*?Must?have?DOS?Share.exe?loaded?for?*/?
???/*?file?locking?to?function?properly?*/?
???handle?=?sopen("c:\\autoexec.bat",?
??????O_RDONLY,SH_DENYNO,S_IREAD);?
???if?(handle?<?0)?
???{?
??????printf("sopen?failed\n");?
??????exit(1);?
???}?
???length?=?filelength(handle);?
???status?=?lock(handle,0L,length/2);?
???if?(status?==?0)?
??????printf("lock?succeeded\n");?
???else?
??????printf("lock?failed\n");?
???status?=?unlock(handle,0L,length/2);?
???if?(status?==?0)?
??????printf("unlock?succeeded\n");?
???else?
??????printf("unlock?failed\n");?
???close(handle);?
???return?0;?
}?
??
??

函数名:?log?

功??能:?对数函数ln(x)?

用??法:?double?log(double?x);?

程序例:?

#include?<math.h>?
#include?<stdio.h>?
int?main(void)?
{?
???double?result;?
???double?x?=?8.6872;?
???result?=?log(x);?
???printf("The?natural?log?of?%lf?is?%lf\n",?x,?result);?
???return?0;?
}?
??
??

函数名:?log10?

功??能:?对数函数log?

用??法:?double?log10(double?x);?

程序例:?

#include?<math.h>?
#include?<stdio.h>?
int?main(void)?
{?
???double?result;?
???double?x?=?800.6872;?
???result?=?log10(x);?
???printf("The?common?log?of?%lf?is?%lf\n",?x,?result);?
???return?0;?
}?
??
??
??

函数名:?longjump?

功??能:?执行非局部转移?

用??法:?void?longjump(jmp_buf?env,?int?val);?

程序例:?

#include?<stdio.h>?
#include?<setjmp.h>?
#include?<stdlib.h>?
void?subroutine(jmp_buf);?
int?main(void)?
{?
???int?value;?
???jmp_buf?jumper;?
???value?=?setjmp(jumper);?
???if?(value?!=?0)?
???{?
??????printf("Longjmp?with?value?%d\n",?value);?
??????exit(value);?
???}?
???printf("About?to?call?subroutine?...?\n");?
???subroutine(jumper);?
???return?0;?
}?
void?subroutine(jmp_buf?jumper)?
{?
???longjmp(jumper,1);?
}?
??
??
??

函数名:?lowvideo?

功??能:?选择低亮度字符?

用??法:?void?lowvideo(void);?

程序例:?

#include?<conio.h>?
int?main(void)?
{?
???clrscr();?
???highvideo();?
???cprintf("High?Intesity?Text\r\n");?
???lowvideo();?
???gotoxy(1,2);?
???cprintf("Low?Intensity?Text\r\n");?
???return?0;?
}?
??
??
??

函数名:?lrotl,?_lrotl?

功??能:?将无符号长整型数向左循环移位?

用??法:?unsigned?long?lrotl(unsigned?long?lvalue,?int?count);?

?unsigned?long?_lrotl(unsigned?long?lvalue,?int?count);?

程序例:?

/*?lrotl?example?*/?
#include?<stdlib.h>?
#include?<stdio.h>?
int?main(void)?
{?
???unsigned?long?result;?
???unsigned?long?value?=?100;?
???result?=?_lrotl(value,1);?
???printf("The?value?%lu?rotated?left?one?bit?is:?%lu\n",?value,?result);?
???return?0;?
}?
??
??

函数名:?lsearch?

功??能:?线性搜索?

用??法:?void?*lsearch(const?void?*key,?void?*base,?size_t?*nelem,?

???????size_t?width,?int?(*fcmp)(const?void?*,?const?void?*));?

程序例:?

#include?<stdio.h>?
#include?<stdlib.h>?
int?compare(int?*x,?int?*y)?
{?
???return(?*x?-?*y?);?
}?
int?main(void)?
{?
???int?array[5]?=?{35,?87,?46,?99,?12};?
???size_t?nelem?=?5;?
???int?key;?
???int?*result;?
???key?=?99;?
???result?=?lfind(&key,?array,?&nelem,?
???????????????sizeof(int),?(int(*)(const?void?*,const?void?*))compare);?
???if?(result)?
??????printf("Number?%d?found\n",key);?
???else?
??????printf("Number?%d?not?found\n",key);?
???return?0;?
}?
??
??
??

函数名:?lseek?

功??能:?移动文件读/写指针?

用??法:?long?lseek(int?handle,?long?offset,?int?fromwhere);?

程序例:?

#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("TEST.$$$",?O_CREAT?|?O_RDWR,?S_IREAD?|?S_IWRITE);?
???/*?write?some?data?to?the?file?*/?
???write(handle,?msg,?strlen(msg));?
???/*?seek?to?the?begining?of?the?file?*/?
???lseek(handle,?0L,?SEEK_SET);?
???/*?reads?chars?from?the?file?until?we?hit?EOF?*/?
???do?
???{?
??????read(handle,?&ch,?1);?
??????printf("%c",?ch);?
???}??while?(!eof(handle));?
???close(handle);?
???return?0;?
}?
??
??
??
??
?

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

时间: 2025-01-18 04:01:53

L.xml的相关文章

XML详解:第一部分

声明:原创作品,转载时请注明文章来自SAP师太技术博客:www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将追究法律责任!原文链接:http://www.cnblogs.com/jiangzhengjun/p/4290887.html XML概述... 3 XML基本语法... 4 文档声明... 4 标签.文本.元素... 5 元素定义... 5 属性定义... 7 注释... 8 处理指令... 8 非法的PCDATA字符... 8 XML名称空

XML概念,约束文档,解析

day01总结 今日内容 l XML语法 l XML约束之DTD l XML解析器介绍 l XML解析之JAXP( DOM.SAX ) l DOM4J l Schema 一.XML语法 XML概述 1 什么是XML XML全称为Extensible Markup Language, 意思是可扩展的标记语言,它是 SGML(标准通用标记语言)的一个子集. XML语法上和HTML比较相似,但HTML中的元素是固定的,而XML的标签是可以由用户自定义的. W3C在1998年2月发布1.0版本: W3C

xml学习

1.什么是XML XML全称为Extensible Markup Language, 意思是可扩展的标记语言,它是 SGML(标准通用标记语言)的一个子集. XML语法上和HTML比较相似,但HTML中的元素是固定的,而XML的标签是可以由用户自定义的. W3C在1998年2月发布1.0版本: W3C在2004年2月发布1.1版本,但因为1.1版本不能向下兼容1.0版本,所以1.1没有人用.同时,在2004年2月W3C又发布了1.0版本的第三版.我们要学习的还是1.0版本!!! 2.W3C组织

XML技术-Schema约束-Dom4j-Xpath详解

这辈子没办法做太多事情所以每一件都要做到精彩绝伦 People can't do too many things in my life,so everything will be wonderful   乔布斯 本文档参考资料w3cschool.CHM  API教程文档免费下载地址http://down.51cto.com/data/2300287 XML技术 1.     什么是XML XML 指可扩展标记语言EXtensibleMarkup Language XML 是一种标记语言很类似 H

XML基础+Java解析XML +几种解析方式的性能比较

XML基础+Java解析XML 一:XML基础 XML是什么: 可扩展的标记语言 XML能干什么: 描述数据.存储数据.传输(交换)数据. XML与HTML区别: 目的不一样 XML 被设计用来描述数据,其焦点是数据的内容. HTML 被设计用来展示数据,其焦点是数据的外观. HTML可以不关闭标签(即标签可以不成对出现),但XML必须关闭标签(即标签必须成对出现). HTML中的标签标识文本如何展示,而XML中的标签标识文本是什么含义(什么类型的文本). XML文档节点类型 u     文档(

C#三十 Ado.net和XML

我们经常把数据集说成临时数据库,如果我们把数据集这个临时数据库比作仓库,那么XML就是火车.轮船上的集装箱,数据集负责临时存放数据,Xml负责作为装运数据时的容器,相比数据集来讲Xml甚至还要重要一些.Xml全称eXtensibleMarkup Language,翻译为可扩展标记语言,主要用来作为系统与系统之间传递数据时的载体. 重点: ?      Xml的语法 ?      Xml的组成 ?       如何实现多种数据与Xml的转换 预习功课: ?      Xml的简介与由来 ?    

1.熟练的使用Java语言进行面向对象程序设计,有良好的编程习惯,熟悉常用的Java API,包括集合框架、多线程(并发编程)、I/O(NIO)、Socket、JDBC、XML、反射等。[泛型]\

. 进程和线程之间有什么不同? 一个进程是一个独立(self contained)的运行环境,它可以被看作一个程序或者一个应用.而线程是在进程中执行的一个任务.Java运行环境是一个包含了不同的类和程序的单一进程.线程可以被称为轻量级进程.线程需要较少的资源来创建和驻留在进程中,并且可以共享进程中的资源. 2. 多线程编程的好处是什么? 在多线程程序中,多个线程被并发的执行以提高程序的效率,CPU不会因为某个线程需要等待资源而进入空闲状态. 3. 用户线程和守护线程有什么区别? 当我们在Java

史上最最靠谱,又双叒叒简单的基于MSXML的XML解析指南-C++

目录 史上最最靠谱,又双叒叒简单的基于MSXML的XML解析指南 流程设计 xml信息有哪几种读取形式(xml文件或wchar) 如何选取节点,and取节点属性有哪些方法? IXMLDOMNode与IXMLDOMElement接口有何联系.区别 节点如果是数组,怎么操作? 如何为属性插入属性 字符串的转换与输出 主要代码 史上最最靠谱,又双叒叒简单的基于MSXML的XML解析指南 最近做C++相关的项目,遇到同时使用COM和MSXML来解析XML文件中信息的问题,这类问题如果做MFC开发也会经常

[EA]入门教程

一.简介 生命周期软件设计方案--Enterprise Architect是以目标为导向的软件系统.它覆盖了系统开发的整个周期,除了开发类模型之外,还包括事务进程分析,使用案例需求,动态模型,组件和布局,系统管理,非功能需求,用户界面设计,测试和维护等.为整个团队提供高级的UML 2.0建模工具. EA为用户提供一个高性能.直观的工作界面,联合UML 2.0最新规范,为桌面电脑工作人员.开发和应用团队打造先进的软件建模方案.该产品不仅特性丰富,而且性价比极高,可以用来配备您的整个工作团队,包括分