文件名称: 
Outline of Programming with C 
     
       
      
 
       
         
         
          开发工具:  
        
 
         
          文件大小: 8mb
        
 
         
          下载次数: 0
        
 
         
          上传时间: 2008-02-19
        
 
         
        
      
    
    
     
 详细说明: Outline of Programming with C
Chapter 1 INTRODUCTORY CONCEPTS ......................................................................................... 1 
1.1 Introduction to Computers ............................................................................................. 1 
1.2 Computer Characteristics ............................................................................................... 2 
1.3 Modes of Operation ............................................ ............................................................ 4 
1.4 Types of Programming Languages ................................................................................ 7 
1.5 Introduction to C ............................................................................................................ 7 
1.6 Some Simple C Programs ............................................................................................. 10 
1.7 Desirable Program Characteristics ............................................................................... 18 
Chapter 2 C Fundamentals .................................................................................................................. 24 
2.1 The C Character Set ...................................................................................................... 24 
2.2 Identifiers and Keywords ............................................................................................. 24 
2.3 Data Types ................................................................................................................... 26 
2.4 Constants ...................................................................................................................... 27 
2.5 Variables and Arrays .................................................................................................... 33 
2.6 Declarations .................................................................................................................. 35 
2.7 Expressions .................................................................................................................. 38 
2.8 Statements .................................................................................................................... 39 
2.9 Symbolic Constants ...................................................................................................... 40 
Chapter 3 Operators and Expressions ................................................................................................ 46 
3.1 Arithmetic Operators .................................................................................................... 46 
3.2 Unary Operators ........................................................................................................... 50 
3.3 Relational and Logical Operators ................................................................................. 53 
3.4 Assignment Operators .................................................................................................. 56 
3.5 The Conditional Operator ............................................................................................. 59 
3.6 Library Functions ......................................................................................................... 61 
Chapter 4% Data Input and Output ....................................................................................................... 68 
4.1 Preliminaries ................................................................................................................. 68 
4.2 Single Character Input .The getchar Function ........................................................ 69 
4.3 Single Character Output .The putchar Function ...................................................... 69 
4.4 Entering Input Data .The scanf Function ................................................................. 71 
4.5 More About the scanf Function ................................................................................. 75 
4.6 Writing Output Data .The printf Function ............................................................. 80 
4.7 More About the printf Function ............................................................................... 84 
4.8 The gets and puts Functions ..................................................................................... 89 
4.9 Interactive (Conversational) Programming .................................................................. 90 
Chapter 5 Preparing and Running a Complete C Program ............................................................101 
5.1 Planning a C Program ................................................................................................ 101 
5.2 Writing a C Program .................................................................................................. 103 
5.3 Entering the Program into the Computer ................................................................... 104 
5.4 Compiling and Executing the Program ...................................................................... 106 
5.5 Error Diagnostics ........................................................................................................ 109 
5.6 Debugging Techniques ............................................................................................... 112 
V 
vi CONTENTS 
Chapter 6 Control Statements ........................................................................................................... 122 
6.1 Preliminaries ............................................................................................................... 122 
6.2 Branching: The if .else Statement ......................................................................... 124 
6.3 Looping: The while Statement ................................................................................. 127 
6.4 More Looping: The do .while Statement ................................................................ 130 
6.5 Still More Looping: The for Statement .................................................................... 133 
6.6 Nested Control Structures .......................................................................................... 136 
6.7 The switch Statement ............................................................................................... 146 
6.8 The break Statement ................................................................................................. 153 
6.9 The continue Statement .......................................................................................... 155 
6.10 The Comma Operator ................................................................................................. 157 
6.1 1 The goto Statement ................................................................................................... 160 
Chapter 7 Functions ............................................................................................................................ 174 
7.1 A Brief Overview ....................................................................................................... 174 
7.2 Defining a Function .................................................................................................... 176 
7.3 Accessing a Function ................................................................................................. 179 
7.4 Function Prototypes .................................................................................................... 181 
7.5 Passing Arguments to a Function ............................................................................... 188 
7.6 Recursion .................................................................................................................... 194 
Chapter 8 Program Structure ............................................................................................................ 207 
8.1 Storage Classes ........................................................................................................... 207 
8.2 Automatic Variables ................................................................................................... 208 
8.3 External (Global) Variables ........................................................................................ 210 
8.4 Static Variables .......................................................................................................... 216 
8.5 Multifile Programs ..................................................................................................... 219 
8.6 More About Library Functions .................................................................................. 228 
Chapter 9 Arrays ................................................................................................................................ 241 
9.1 Defining an Array ...................................................................................................... 241 
9.2 Processing an Array ................................................................................................... 245 
9.3 Passing Arrays to Functions ....................................................................................... 248 
9.4 Multidimensional Arrays ............................................................................................ 259 
9.5 Arrays and Strings ...................................................................................................... 265 
Chapter 10 Pointers .............................................................................................................................. 280 
10.1 Fundamentals ........................................................................................................... 280 
10.2 Pointer Declarations ................................................................................................. 283 
10.3 Passing Pointers to Functions ................................................................................... 284 
10.4 Pointers and One-Dimensional Arrays ..................................................................... 291 
10.5 Dynamic Memory Allocation ................................................................................... 294 
10.6 Operations on Pointers ............................................................................................. 297 
10.7 Pointers and Multidimensional Arrays ..................................................................... 299 
10.8 Arrays of Pointers .................................................................................................... 304 
10.9 Passing Functions to Other Functions ...................................................................... 315 
10.10 More about Pointer Declarations .............................................................................. 322 
CONTENTS vii 
Chapter 11 Structures and Unions ...................................................................................................... 338 
1 1.1 Defining a Structure ................................................................................................. 338 
11.2 Processing a Structure .............................................................................................. 343 
1 1.3 User-Defined Data Types (typedef) ...................................................................... 353 
11.4 Structures and Pointers ............................................................................................. 356 
I 1.5 Passing Structures to Functions ................................................................................ 360 
11.6 Self-Referential Structures ....................................................................................... 370 
1 1.7 Unions ...................................................................................................................... 382 
Chapter 12 Data Files ........................................................................................................................... 399 
12.1 Opening and Closing a Data File ............................................................................. 399 
12.2 Creating a Data File ................................................................................................. 401 
12.3 Processing a Data File .............................................................................................. 407 
12.4 Unformatted Data Files ............................................................................................ 412 
Chapter 13 Low-Level Programming ................................................................................................. 424 
13.1 Register Variables .................................................................................................... 424 
13.2 Bitwise Operations ................................................................................................... 427 
13.3 Bit Fields .................................................................................................................. 437 
Chapter 14 Some Additional Features of C ........................................................................................ 450 
14.1 Enumerations ........................................................................................................... 450 
14.2 Command Line Parameters ...................................................................................... 455 
14.3 More About Library Functions ................................................................................ 458 
14.4 Macros ...................................................................................................................... 458 
14.5 The C Preprocessor .................................................................................................. 466 
Appendix A NUMBER SYSTEMS ....................................................................................................... 476 
Appendix B ESCAPE SEQUENCES .................................................................................................... 477 
Appendix c OPERATOR SUMMARY ................................................................................................ 478 
Appendix D DATA TYPES AND DATA CONVERSION RULES .................................................... 479 
Appendix E THE ASCII CHARACTER SET ..................................................................................... 481 
Appendix F CONTROL STATEMENT SUMMARY ......................................................................... 482 
Appendix G COMMONLY USED scanf AND printf CONVERSION CHARACTERS ..........484 
scanf Conversion Characters ............................................................................................ 484 
printf Conversion Characters .......................................................................................... 485 
Flags .................................................................................................................................... 486 
Appendix H COMMONLY USED LIBRARY FUNCTIONS ............................................................ 487 
ANSWERS TO SELECTED PROBLEMS .................................................................................................. 491 
INDEX ............................................................................................................................................. 523 ...展开收缩 
    
 
(系统自动生成,下载前可以参看下载内容)
下载文件列表
 
 
	
 
		
			相关说明
			
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
 
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
 
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
 
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
 
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
 
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.