• C程序设计语言(第2版·新版)[C语言圣经] 英文版 - pdf文本版

    Preface.................................................................................................................................... 6 Preface to the first edition........................................................................................................8 Chapter 1 - A Tutorial Introduction.........................................................................................9 1.1 Getting Started..............................................................................................................9 1.2 Variables and Arithmetic Expressions..........................................................................11 1.3 The for statement.........................................................................................................15 1.4 Symbolic Constants......................................................................................................17 1.5 Character Input and Output.........................................................................................17 1.5.1 File Copying..........................................................................................................18 1.5.2 Character Counting...............................................................................................19 1.5.3 Line Counting.......................................................................................................20 1.5.4 Word Counting.....................................................................................................21 1.6 Arrays..........................................................................................................................23 1.7 Functions.....................................................................................................................25 1.8 Arguments - Call by Value...........................................................................................28 1.9 Character Arrays..........................................................................................................29 1.10 External Variables and Scope.....................................................................................31 Chapter 2 - Types, Operators and Expressions.......................................................................35 2.1 Variable Names............................................................................................................35 2.2 Data Types and Sizes...................................................................................................35 2.3 Constants.....................................................................................................................36 2.4 Declarations.................................................................................................................38 2.5 Arithmetic Operators...................................................................................................39 2.6 Relational and Logical Operators.................................................................................39 2.7 Type Conversions........................................................................................................40 2.8 Increment and Decrement Operators............................................................................43 2.9 Bitwise Operators........................................................................................................45 2.10 Assignment Operators and Expressions......................................................................46 2.11 Conditional Expressions.............................................................................................47 2.12 Precedence and Order of Evaluation..........................................................................48 Chapter 3 - Control Flow.......................................................................................................50 3.1 Statements and Blocks.................................................................................................50 3.2 If-Else..........................................................................................................................50 3.3 Else-If..........................................................................................................................51 3.4 Switch..........................................................................................................................52 3.5 Loops - While and For.................................................................................................53 3.6 Loops - Do-While........................................................................................................56 3.7 Break and Continue.....................................................................................................57 3.8 Goto and labels............................................................................................................57 Chapter 4 - Functions and Program Structure........................................................................59 4.1 Basics of Functions......................................................................................................59 4.2 Functions Returning Non-integers................................................................................61 4.3 External Variables........................................................................................................63 4.4 Scope Rules.................................................................................................................68 4.5 Header Files.................................................................................................................69 4.6 Static Variables............................................................................................................70 4.7 Register Variables........................................................................................................71 4.8 Block Structure............................................................................................................71 4.9 Initialization.................................................................................................................72 4.10 Recursion...................................................................................................................73 4.11 The C Preprocessor....................................................................................................74 4.11.1 File Inclusion.......................................................................................................75 4.11.2 Macro Substitution..............................................................................................75 www.plcworld.cn 3 4.11.3 Conditional Inclusion..........................................................................................77 Chapter 5 - Pointers and Arrays.............................................................................................78 5.1 Pointers and Addresses................................................................................................78 5.2 Pointers and Function Arguments.................................................................................79 5.3 Pointers and Arrays......................................................................................................81 5.4 Address Arithmetic......................................................................................................84 5.5 Character Pointers and Functions.................................................................................87 5.6 Pointer Arrays; Pointers to Pointers.............................................................................89 5.7 Multi-dimensional Arrays.............................................................................................92 5.8 Initialization of Pointer Arrays.....................................................................................93 5.9 Pointers vs. Multi-dimensional Arrays..........................................................................94 5.10 Command-line Arguments..........................................................................................95 5.11 Pointers to Functions.................................................................................................98 5.12 Complicated Declarations.........................................................................................100 Chapter 6 - Structures..........................................................................................................105 6.1 Basics of Structures...................................................................................................105 6.2 Structures and Functions............................................................................................107 6.3 Arrays of Structures...................................................................................................109 6.4 Pointers to Structures.................................................................................................112 6.5 Self-referential Structures...........................................................................................113 6.6 Table Lookup............................................................................................................117 6.7 Typedef......................................................................................................................119 6.8 Unions.......................................................................................................................120 6.9 Bit-fields....................................................................................................................121 Chapter 7 - Input and Output...............................................................................................124 7.1 Standard Input and Output.........................................................................................124 7.2 Formatted Output - printf...........................................................................................125 7.3 Variable-length Argument Lists..................................................................................127 7.4 Formatted Input - Scanf.............................................................................................128 7.5 File Access.................................................................................................................130 7.6 Error Handling - Stderr and Exit................................................................................132 7.7 Line Input and Output................................................................................................134 7.8 Miscellaneous Functions............................................................................................135 7.8.1 String Operations................................................................................................135 7.8.2 Character Class Testing and Conversion..............................................................135 7.8.3 Ungetc................................................................................................................135 7.8.4 Command Execution...........................................................................................135 7.8.5 Storage Management..........................................................................................136 7.8.6 Mathematical Functions.......................................................................................136 7.8.7 Random Number generation................................................................................136 Chapter 8 - The UNIX System Interface..............................................................................138 8.1 File Descriptors..........................................................................................................138 8.2 Low Level I/O - Read and Write................................................................................139 8.3 Open, Creat, Close, Unlink........................................................................................140 8.4 Random Access - Lseek.............................................................................................142 8.5 Example - An implementation of Fopen and Getc.......................................................142 8.6 Example - Listing Directories.....................................................................................145 8.7 Example - A Storage Allocator..................................................................................149 Appendix A - Reference Manual..........................................................................................154 A.1 Introduction..............................................................................................................154 A.2 Lexical Conventions..................................................................................................154 A.2.1 Tokens...............................................................................................................154 A.2.2 Comments..........................................................................................................154 www.plcworld.cn 4 A.2.3 Identifiers...........................................................................................................154 A.2.4 Keywords...........................................................................................................154 A.2.5 Constants...........................................................................................................155 A.2.6 String Literals.....................................................................................................156 A.3 Syntax Notation........................................................................................................156 A.4 Meaning of Identifiers...............................................................................................157 A.4.1 Storage Class.....................................................................................................157 A.4.2 Basic Types........................................................................................................157 A.4.3 Derived types.....................................................................................................158 A.4.4 Type Qualifiers...................................................................................................158 A.5 Objects and Lvalues..................................................................................................158 A.6 Conversions..............................................................................................................159 A.6.1 Integral Promotion.............................................................................................159 A.6.2 Integral Conversions...........................................................................................159 A.6.3 Integer and Floating...........................................................................................159 A.6.4 Floating Types....................................................................................................159 A.6.5 Arithmetic Conversions......................................................................................159 A.6.6 Pointers and Integers..........................................................................................160 A.6.7 Void...................................................................................................................160 A.6.8 Pointers to Void.................................................................................................161 A.7 Expressions...............................................................................................................161 A.7.1 Pointer Conversion.............................................................................................161 A.7.2 Primary Expressions...........................................................................................161 A.7.3 Postfix Expressions............................................................................................162 A.7.4 Unary Operators.................................................................................................164 A.7.5 Casts..................................................................................................................165 A.7.6 Multiplicative Operators.....................................................................................165 A.7.7 Additive Operators.............................................................................................166 A.7.8 Shift Operators...................................................................................................166 A.7.9 Relational Operators...........................................................................................167 A.7.10 Equality Operators...........................................................................................167 A.7.11 Bitwise AND Operator.....................................................................................167 A.7.12 Bitwise Exclusive OR Operator........................................................................167 A.7.13 Bitwise Inclusive OR Operator.........................................................................168 A.7.14 Logical AND Operator.....................................................................................168 A.7.15 Logical OR Operator........................................................................................168 A.7.16 Conditional Operator........................................................................................168 A.7.17 Assignment Expressions...................................................................................169 A.7.18 Comma Operator..............................................................................................169 A.7.19 Constant Expressions.......................................................................................169 A.8 Declarations..............................................................................................................170 A.8.1 Storage Class Specifiers.....................................................................................170 A.8.2 Type Specifiers...................................................................................................171 A.8.3 Structure and Union Declarations.......................................................................172 A.8.4 Enumerations.....................................................................................................174 A.8.5 Declarators.........................................................................................................175 A.8.6 Meaning of Declarators......................................................................................176 A.8.7 Initialization.......................................................................................................178 A.8.8 Type names........................................................................................................180 A.8.9 Typedef..............................................................................................................181 A.8.10 Type Equivalence.............................................................................................181 A.9 Statements................................................................................................................181 A.9.1 Labeled Statements.............................................................................................182 www.plcworld.cn 5 A.9.2 Expression Statement.........................................................................................182 A.9.3 Compound Statement.........................................................................................182 A.9.4 Selection Statements..........................................................................................183 A.9.5 Iteration Statements...........................................................................................183 A.9.6 Jump statements.................................................................................................184 A.10 External Declarations..............................................................................................184 A.10.1 Function Definitions.........................................................................................185 A.10.2 External Declarations.......................................................................................186 A.11 Scope and Linkage..................................................................................................186 A.11.1 Lexical Scope...................................................................................................187 A.11.2 Linkage............................................................................................................187 A.12 Preprocessing..........................................................................................................187 A.12.1 Trigraph Sequences..........................................................................................188 A.12.2 Line Splicing....................................................................................................188 A.12.3 Macro Definition and Expansion.......................................................................188 A.12.4 File Inclusion....................................................................................................190 A.12.5 Conditional Compilation...................................................................................191 A.12.6 Line Control.....................................................................................................192 A.12.7 Error Generation..............................................................................................192 A.12.8 Pragmas............................................................................................................192 A.12.9 Null directive....................................................................................................192 A.12.10 Predefined names............................................................................................192 A.13 Grammar.................................................................................................................193 Appendix B - Standard Library............................................................................................199 B.1 Input and Output: <stdio.h>......................................................................................199 B.1.1 File Operations...................................................................................................199 B.1.2 Formatted Output...............................................................................................200 B.1.3 Formatted Input..................................................................................................202 B.1.4 Character Input and Output Functions................................................................203 B.1.5 Direct Input and Output Functions......................................................................204 B.1.6 File Positioning Functions...................................................................................204 B.1.7 Error Functions..................................................................................................205 B.2 Character Class Tests: <ctype.h>...............................................................................205 B.3 String Functions: <string.h>......................................................................................205 B.4 Mathematical Functions: <math.h>............................................................................206 B.5 Utility Functions: <stdlib.h>......................................................................................207 B.6 Diagnostics: <assert.h>..............................................................................................209 B.7 Variable Argument Lists: <stdarg.h>.........................................................................209 B.8 Non-local Jumps: <setjmp.h>....................................................................................210 B.9 Signals: <signal.h>....................................................................................................210 B.10 Date and Time Functions: <time.h>.........................................................................210 B.11 Implementation-defined Limits: <limits.h> and <float.h>.........................................212 Appendix C - Summary of Changes.....................................................................................214

    0
    0
    3.45MB
    2017-01-01
    16
  • WIN7下硬盘安装Ubuntu_11.04双系统教程doc

    Win7下硬盘安装Ubuntu11.04双系统 欢迎大家访问我们的网站:Linux起点:http://www.linuxqd.com起点论坛:http://www.linuxqd.com/bbss起点超级Q群:㈠10218442 ㈡92186523 ㈢90282859 ㈣106637392一、准备工作(在win7下操作完成)1.从官网www.ubuntu.com上下载镜像文件,大小接近700M。 2.下载并安装easybcd。easybcd是一款很优秀的系统引导软件,功能强大,最关键的是傻瓜式一站式简易操作,极其适合新手使用!网上很多说用grubdos安装,但对于菜鸟的我来说,操作太麻烦而且容易引导失败!3.腾出一个空盘,点击右键格式化之后把它删除(这个盘最好是在硬盘的后面,因为Windows系统不能识别Linux系统分区,如果将ubuntu装在D盘,将D盘删除并建立Linux系统分区后,原来的E盘就会变成D盘,安装在E盘的软件会出现系统注册表路径不对称,要重新安装一遍软件)。网上很多说使用磁盘压缩功能以整理出空白分区,这个方法也可行,但这个盘要保证有10G空间以上比较稳妥。 4.安装好easybcd2.0后,启动软件:......

    5
    205
    825KB
    2013-08-28
    15
  • 大型网站性能优化.doc

    1、HTML静态化其实大家都知道,效率最高、消耗最小的就是纯静态化的html页面,所以 我们尽可能使我们的网站上的页面采用静态页面来实现,这个最简单的方法其实也是最有效的方法。但是对于大量内容并且频繁更新的网站,我们无法全部手动去挨 个实现,于是出现了我们常见的信息发布系统CMS,像我们常访问的各个门户站点的新闻频道,甚至他们的其他频道,都是通过信息发布系统来管理和实现的,信 息发布系统可以实现最简单的信息录入自动生成静态页面,还能具备频道管理、权限管理、自动抓取等功能,对于一个大型网站来说,拥有一套高效、可管理的 CMS是必不可少的。除了门户和信息发布类型的网站,对于交互性要求很高的社区类型网站来说,尽可能的静态化也是提高性能的必要手段,将社区内的帖子、文 章进行实时的静态化,有更新的时候再重新静态化也是大量使用的......

    5
    85
    40KB
    2013-08-28
    9
  • C++程序设计谭浩强100%25完整·清华大学.pdf

    C++程序设计谭浩强100%25完整·清华大学.pdf

    0
    38
    5.71MB
    2013-08-28
    33
  • aflax官方源码包(doc,examples)

    绝对官方绝对官方绝对官方绝对官方绝对官方绝对官方绝对官方 aflax官方源码包(doc,examples)aflax官方源码包(doc,examples)aflax官方源码包(doc,examples)

    5
    46
    20.64MB
    2013-03-29
    9
  • Java/c常见算法大全

    老掉牙 河内塔 费式数列 巴斯卡三角形 三色棋 老鼠走迷官(一) 老鼠走迷官(二) 骑士走棋盘 八个皇后 八枚银币 生命游戏 字串核对 双色、三色河内塔 背包问题(Knapsack Problem) 数、运算 蒙地卡罗法求 PI Eratosthenes筛选求 质数 超长整数运算(大数运算) 长 PI 最大公因数、最小公倍数、因式分解 完美数 阿姆斯壮数 最大访客数 中序式转后序式(前序式) 后序式的运算 关于赌博 洗扑克牌(乱数排列) Craps赌博游戏 约瑟夫问题(Josephus Problem) 集合问题 排列组合 格雷码(Gray Code) 产生可能的集合 m元素集合的n个元素子集 数字拆解 排序 得分排行 选择、插入、气泡 排序 Shell 排序法 - 改良的插入排序 Shaker 排序法 - 改良的气泡排序 Heap 排序法 - 改良的选择排序 快速排序法(一) 快速排序法(二) 快速排序法(三) 合并排序法 基数排序法 搜寻 循序搜寻法(使用卫兵) 二分搜寻法(搜寻原则的代表) 插补搜寻法 费氏搜寻法 矩阵 稀疏矩阵 多维矩阵转一维矩阵 上三角、下三角、对称矩阵 奇数魔方阵 4N 魔方阵 2(2N+1) 魔方阵 堆叠、伫列 堆叠 - 使用阵列实作 堆叠 - 使用链结实作(C 语言动态记忆体宣告) 堆叠 - 使用 Java 作物件封装 伫列 - 使用阵列实作 伫列 - 使用链结实作(C语言动态记忆体宣告) 伫列 - 使用Java 作物件封装 其它 自产生程式(quine)

    0
    34
    693KB
    2013-03-29
    0
  • 2011国际C语言混乱代码大赛所有获奖作品源代码

    20届IOCCC比赛获奖结果和代码4月15日完整公布。国际C语言混乱代码大赛(IOCCC, The International Obfuscated C Code Contest)是一项著名的国际编程赛事,从1984年开始到2006年,每年举办一次。2006年后中止了多年,2011年又开始恢复。比赛的目的是写出最有创意的最让人难以理解的C语言代码,当然有好玩的成分,但也能充分展示C语言和程序员的强大。

    5
    495
    513KB
    2012-04-29
    44
  • MySQL存储过程

    简单的来说是介绍了“存储过程、触发器、视图、信息架构视图”,这是介绍MySQL 5.0新特性丛书的第一集。希望这本书能像内行专家那样与您进行对话,用简单的问题、例子让你学到需要的知识。 为了达到这样的目的,我会从每一个细节开始慢慢的为大家建立概念,最后会给大家展示较大的实用用例,在学习之前也许大家会认为这个用例很难,但是只要跟着课程去学,相信很快就能掌握。

    5
    82
    2.12MB
    2012-04-29
    0
  • JQuery_1.4_API.CHM 中文版

    2010年1月22日,更新至JQuery 1.4版本,本版是参考shawphy的1.4在线版本(http://jquery-api-zh-cn.googlecode.com/svn/trunk/xml/jqueryapi.xml)制作,更新了好多以前的内容,以前没仔细核对过,发现之前网上流行的chm版本基本都基于1.2的,1.3的内容很多都没加进去,这次都补全了。用*标注了1.3版本新加的内容,@标注1.4新加的内容,方便大家查看。 如果发现什么错误,请联系我:www.ajaxa.cn,QQ:274430124 -------------------------------------------------------------------------------- 下载最新的jQuery文件 jQuery 1.4 Minified (23kb Gzipped) jQuery 1.4 Regular (154kb)

    5
    42
    490KB
    2011-11-30
    2
  • 臧圩人--JAVA面试题解惑系列合集

    本文档来自于“臧圩人--JAVA面试题解惑系列合集”。我看了很受用。于是共享下,也赚点积分。

    0
    48
    774KB
    2011-09-04
    3
上传资源赚积分or赚钱