数据结构学习(一)

最近准备重新复习一下数据结构,并附带复习一下C语言,为了以后编写代码的方便,将所有常见的头文件和常量定义等定义到一个文件global.h。 

该文件内容如下:

global.h
 1 /* 串复制如:strcpy,strncpy,memcpy,memmove,strxfrm */
 2 /* 串连接如:strcat,strncat */
 3 /* 串比较如:strcmp,strncmp,memcmp,strcoll */
 4 /* 串查找如:strchr,strrchr,strstr,strspn,strcspn,strpbrk,strtok */
 5 /* 其他如:strlen,memset,strerror */
 6 #include<string.h> 
 7 
 8 /* 三角函数如:sin,cos,tan */
 9 /* 反三角函数如:asin,acos,atan,atan2 */
10 /* 双曲三角函数如:sinh,cosh,tanh */
11 /* 指数和对数如:exp,pow,sqrt,log,log10 */
12 /* 取整如:ceil,floor */
13 /* 绝对值如:abs */
14 /* 标准化浮点数如:frexp,ldexp */
15 /* 取整和取余如:modf,fmod*/
16 #include<math.h>
17 
18 /* 字符测试函数如:isalpha,isdigit,isxdigit,isalnum==isalpha||isdigit
19                    islower,isupper,isspace,isgraph,isprint,ispunct,iscntrl */
20 /* 字符映射函数如:tolower,toupper */
21 #include<ctype.h>
22 
23 /* 字符串转化:atof,atoi,atol,strtod,strtol,strtoul */
24 /* 随机数如:srand,rand */
25 /* 内存管理:NULL,calloc,malloc,realloc,free */
26 /* 与环境接口:abort,exit,atexit,system,getenv */
27 /* 查找排序:bsearch,qsort,comp */
28 /* 注意stdlib为MS定义的标准库,重新实现了iso定义的malloc.h中的功能 */
29 #include<stdlib.h>
30 
31 /* 整形的最大最小值:INT_MAX,INT_MIN,CHAR_MAX,CHAR_MIN,LONG_MAX,LONG_MIN 等 */
32 #include<limits.h>
33 
34 /* 标准IO库:getchar,putchar,scanf,printf,puts,gets,sprintf 等 */
35 #include<stdio.h>
36 
37 /* 特殊IO库(文件):open,read,write,close,_open,_close,eof 等 */
38 #include<io.h>
39 
40 /* 进程管理库:abort,getpid,exit,_exit,spawnl,system 等 */
41 #include<process.h>
42 
43 /* C++IO库:cout,cin 等 */
44 /* <iostream>引用了std以便解决函数命名冲突 */
45 #include<iostream.h>
46 
47 //函数结果状态代码
48 #define TRUE 1
49 #define FALSE 0
50 #define OK 1
51 #define ERROR 0
52 #define INFEASIBLE -1
53 #define OVERFLOW 3  //在math.h中定义为3,这里可以去掉
54 
55 //定义两种整形别名
56 typedef int Status;
57 typedef int Boolean; 

 

posted on 2010-06-08 13:21  虚怀若谷  阅读(373)  评论(0编辑  收藏  举报

导航