您好,欢迎光临本网站![请登录][注册会员]  
文件名称: programing in C
  所属分类: C
  开发工具:
  文件大小: 4mb
  下载次数: 0
  上传时间: 2009-10-29
  提 供 者: rjlo*****
 详细说明: 一本实用的C语言入门教程 英文版 Contents At a Glance Preface xvii 1 Introduction 1 2 Some Fundamentals 5 3 Compiling and Running Your First Program 11 4 Variables, Data Types, and Arithmetic Expressions 21 5 Program Looping 43 6 Making Decisions 65 7 Working with Arrays 95 8 W orking with Functions 119 9 Working with Structures 165 10 Character Strings 195 11 Pointers 235 12 Operations on Bits 279 13 The Preprocessor 299 14 More on Data Types 321 15 Working with Larger Programs 333 16 Input and Output Operations in C 347 17 Miscellaneous and Advanced Features 373 18 Debugging Programs 389 19 Object-Oriented Programming 411 A C Language Summary 425 B The Standard C Library 467 C Compiling Programs with gcc 493 D Common Programming Mistakes 497 E Resources 501 Index 505 Table of Contents 1 Introduction 1 2 Some Fundamentals 5 Programming 5 Higher-Level Languages 6 Operating Systems 6 Compiling Programs 7 Integrated Development Environments 10 Language Interpreters 10 3 Compiling and Running Your First Program 11 Compiling Your Program 11 Running Your Program 12 Understanding Your First Program 13 Displaying the Values of Variables 15 Comments 17 Exercises 19 4 Variables, Data Types, and Arithmetic Expressions 21 Working with Variables 21 Understanding Data Types and Constants 23 The Basic Integer Type int 23 The Floating Number Type float 24 The Extended Precision Type double 25 The Single Character Type char 25 The Boolean Data Type _Bool 26 Type Specifiers: long, long long, short, unsigned, and signed 28 Working with Arithmetic Expressions 30 Integer Arithmetic and the Unary Minus Operator 33 The Modulus Operator 35 Integer and Floating-Point Conversions 36 viii Contents Combining Operations with Assignment:The Assignment Operators 38 Types _Complex and _Imaginary 39 Exercises 40 5 Program Looping 43 The for Statement 44 Relational Operators 46 Aligning Output 50 Program Input 51 Nested for Loops 53 for Loop Variants 54 The while Statement 56 The do Statement 60 The break Statement 62 The continue Statement 62 Exercises 63 6 Making Decisions 65 The if Statement 65 The if-else Construct 69 Compound Relational Tests 72 Nested if Statements 75 The else if Construct 76 The switch Statement 84 Boolean Variables 87 The Conditional Operator 91 Exercises 93 7 Working with Arrays 95 Defining an Array 96 Using Array Elements as Counters 100 Generating Fibonacci Numbers 103 Using an Array to Generate Prime Numbers 104 Initializing Arrays 106 Contents ix Character Arrays 108 Base Conversion Using Arrays 109 The const Qualifier 111 Multidimensional Arrays 113 Variable-Length Arrays 115 Exercises 117 8 Working with Functions 119 Defining a Function 119 Arguments and Local Variables 122 Function Prototype Declaration 124 Automatic Local Variables 124 Returning Function Results 126 Functions Calling Functions Calling… 131 Declaring Return Types and Argument Types 134 Checking Function Arguments 135 Top-Down Programming 137 Functions and Arrays 137 Assignment Operators 142 Sorting Arrays 143 Multidimensional Arrays 146 Global Variables 152 Automatic and Static Variables 156 Recursive Functions 159 Exercises 162 9 Working with Structures 165 A Structure for Storing the Date 166 Using Structures in Expressions 168 Functions and Structures 171 A Structure for Storing the Time 177 Initializing Structures 180 Compound Literals 181 Arrays of Structures 182 Structures Containing Structures 185 x Contents Structures Containing Arrays 187 Structure Variants 190 Exercises 191 10 Character Strings 195 Arrays of Characters 196 Variable-Length Character Strings 198 Initializing and Displaying Character Strings 201 Testing Two Character Strings for Equality 204 Inputting Character Strings 206 Single-Character Input 208 The Null String 213 Escape Characters 216 More on Constant Strings 218 Character Strings, Structures, and Arrays 219 A Better Search Method 222 Character Operations 227 Exercises 230 11 Pointers 235 Defining a Pointer Variable 235 Using Pointers in Expressions 239 Working with Pointers and Structures 240 Structures Containing Pointers 243 Linked Lists 244 The Keyword const and Pointers 253 Pointers and Functions 254 Pointers and Arrays 259 A Slight Digression About Program Optimization 263 Is It an Array or Is It a Pointer? 264 Pointers to Character Strings 266 Constant Character Strings and Pointers 267 The Increment and Decrement Operators Revisited 268 Operations on Pointers 272 Contents xi Pointers to Functions 273 Pointers and Memory Addresses 274 Exercises 276 12 Operations on Bits 279 Bit Operators 280 The Bitwise AND Operator 281 The Bitwise Inclusive-OR Operator 283 The Bitwise Exclusive-OR Operator 284 The Ones Complement Operator 285 The Left Shift Operator 287 The Right Shift Operator 287 A Shift Function 288 Rotating Bits 290 Bit Fields 292 Exercises 297 13 The Preprocessor 299 The #define Statement 299 Program Extendability 303 Program Portability 305 More Advanced Types of Definitions 306 The # Operator 312 The ## Operator 313 The #include Statement 313 System Include Files 316 Conditional Compilation 316 The #ifdef, #endif, #else, and #ifndef Statements 316 The #if and #elif Preprocessor Statements 318 The #undef Statement 319 Exercises 320 14 More on Data Types 321 Enumerated Data Types 321 The typedef Statement 325 xii Contents Data Type Conversions 327 Sign Extension 329 Argument Conversion 329 Exercises 330 15 Working with Larger Programs 333 Dividing Your Program into Multiple Files 333 Compiling Multiple Source Files from the Command Line 334 Communication Between Modules 336 External Variables 336 StaticVersus ExternVariables and Functions 339 Using Header Files Effectively 341 Other Utilities for Working with Larger Programs 342 The make Utility 343 The cvs Utility 344 Unix Utilities: ar, grep, sed, and so on 345 16 Input and Output Operations in C 347 Character I/O: getchar and putchar 348 Formatted I/O: printf and scanf 348 The printf Function 348 The scanf Function 355 Input and Output Operations with Files 359 Redirecting I/O to a File 359 End of File 361 Special Functions for Working with Files 363 The fopen Function 363 The getc and putc Functions 365 The fclose Function 365 The feof Function 367 The fprintf and fscanf Functions 368 The fgets and fputs Functions 368 stdin, stdout, and stderr 369 The exit Function 370 Renaming and Removing Files 371 Exercises 371 Contents xiii 17 Miscellaneous and Advanced Features 373 Miscellaneous Language Statements 373 The goto Statement 373 The null Statement 374 Working with Unions 375 The Comma Operator 378 Type Qualifiers 378 The register Qualifier 378 The volatile Qualifier 379 The restrict Qualifier 379 Command-Line Arguments 380 Dynamic Memory Allocation 383 The calloc and malloc Functions 384 The sizeof Operator 385 The free Function 387 18 Debugging Programs 389 Debugging with the Preprocessor 389 Debugging Programs with gdb 395 Working with Variables 398 Source File Display 399 Controlling Program Execution 400 Getting a Stack Trace 405 Calling Functions and Setting Arrays and Structures 405 Getting Help with gdb Commands 406 Odds and Ends 408 19 Object-Oriented Programming 411 What Is an Object Anyway? 411 Instances and Methods 412 Writing a C Program to Work with Fractions 413 Defining an Objective-C Class to Work with Fractions 414 Defining a C++ Class to Work with Fractions 419 Defining a C# Class to Work with Fractions 422 xiv Contents A C Language Summary 425 1.0 Digraphs and Identifiers 425 1.1 Digraph Characters 425 1.2 Identifiers 425 2.0 Comments 426 3.0 Constants 427 3.1 Integer Constants 427 3.2 Floating-Point Constants 427 3.3 Character Constants 428 3.4 Character String Constants 429 3.5 Enumeration Constants 430 4.0 Data Types and Declarations 430 4.1 Declarations 430 4.2 Basic Data Types 430 4.3 Derived Data Types 432 4.4 Enumerated Data Types 438 4.5 The typedef Statement 438 4.6 Type Modifiers const, volatile, and restrict 439 5.0 Expressions 439 5.1 Summary of C Operators 440 5.2 Constant Expressions 442 5.3 Arithmetic Operators 443 5.4 Logical Operators 444 5.5 Relational Operators 444 5.6 Bitwise Operators 445 5.7 Increment and Decrement Operators 445 5.8 Assignment Operators 446 5.9 Conditional Operators 446 5.10 Type Cast Operator 446 5.11 sizeof Operator 447 5.12 Comma Operator 447 5.13 Basic Operations with Arrays 447 5.14 Basic Operations with Structures 448 5.15 Basic Operations with Pointers 448 5.16 Compound Literals 450 5.17 Conversion of Basic Data Types 451 Contents xv 6.0 Storage Classes and Scope 452 6.1 Functions 452 6.2 Variables 452 7.0 Functions 454 7.1 Function Definition 454 7.2 Function Call 455 7.3 Function Pointers 456 8.0 Statements 456 8.1 Compound Statements 456 8.2 The break Statement 456 8.3 The continue Statement 457 8.4 The do Statement 457 8.5 The for Statement 457 8.6 The goto Statement 458 8.7 The if Statement 458 8.8 The null Statement 458 8.9 The return Statement 459 8.10 The switch Statement 459 8.11 The while Statement 460 9.0 The Preprocessor 460 9.1 Trigraph Sequences 460 9.2 Preprocessor Directives 461 9.3 Predefined Identifiers 466 B The Standard C Library 467 Standard Header Files 467 467 468 469 469 469 String Functions 470 Memory Functions 472 Character Functions 473 I/O Functions 473 In-Memory Format Conversion Functions 478 String-to-Number Conversion 479 xvi Contents Dynamic Memory Allocation Functions 481 Math Functions 482 Complex Arithmetic 488 General Utility Functions 490 C Compiling Programs with gcc 493 General Command Format 493 Command-Line Options 494 D Common Programming Mistakes 497 E Resources 501 Answers to Exercises, Errata, etc. 501 The C Programming Language 501 Books 501 Web Sites 502 Newsgroups 502 C Compilers and Integrated Development Environments 502 gcc 502 MinGW 502 CygWin 502 Visual Studio 503 CodeWarrior 503 Kylix 503 Miscellaneous 503 Object-Oriented Programming 503 The C++ Language 503 The C# Language 503 The Objective-C Language 503 Development Tools 504 Index 505 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: C语言
 输入关键字,在本站1000多万海量源码库中尽情搜索: