جزییات کتاب
Preface xi Part I - Start up! 1 1 Getting started 3 1.1 C and the generations of programming languages 3A A 1.2 A first C program 5A A 1.3 The C compiler 8A A 1.4 More programs 11A A 1.5 Exercises 19 2 Data types and input/output 23 2.1 Variables, constants, and data types 23A A 2.2 Constants in C 24A A 2.3 Variables in C, and their data types 27A A 2.3.1 Integral data types (fixed point numbers) 27A A 2.3.2 Floating point data types 29A A 2.4 Input/output routines in C 30A A 2.5 Input/output of single characters 32A A 2.6 Exercises 33 3 Operators and expressions 39 3.1 Reserved words in C 39A A 3.2 Operators 40A A 3.2.1 Arithmetic operators 42A A 3.2.2 Relational operators 43A A 3.2.3 Assignment operators 45A A 3.2.4 Logical operators 49A A 3.2.5 Bit manipulation operators 51A A 3.2.6 The remaining operators 58A A 3.3 Exercises 61 4 Control instructions 63 4.1 Jumps 63A A 4.2 Control instructions in C 64A A 4.2.1 Loops 64A A 4.2.2 Alternatives 68A A 4.3 Problems in turning structure charts into C programs 73A A 4.4 Exercises 78 5 Vectors/arrays 81 5.1 Vectors (one-dimensional arrays) 82A A 5.2 Sorting a vector 87A A 5.3 Initializing vectors 91A A 5.4 Passing vectors to functions as arguments 92A A 5.5 Multidimensional arrays 101A A 5.6 Exercises 106 6 Pointers 109 6.1 Simple pointers 109A A 6.2 Pointers and vectors. Pointer arithmetic 114A A 6.3 Pointers to various data types 120A A 6.4 Pointers as function parameters 123A A 6.5 Vectors of pointers 128A A 6.6 Pointers to pointers 132A A 6.7 Pointers to pointers as function parameters 135A A 6.8 Pointers to vectors 139A A 6.9 Some consolation 143A A 6.10 Exercises 144 7 Memory classes 151 7.1 Exercises 161 8 Modular programming libraries 165 8.1 What is modular programming? 165A A 8.2 A "sorted stack" 166A A 8.3 Project management 172A A 8.4 Libraries 176A A 8.5 An improved "sorted stack" 180A A 8.6 Exercises 185 9 Functions 189 9.1 Definition, declaration, calling 189A A 9.2 Processes on the stack 194A A 9.3 Recursive functions 199A A 9.4 Pointers to functions 205A A 9.5 An application: sorting with qsort() 209A A 9.6 Search with bsearch() 213A A 9.7 Exercises 215 10 The C pre-processor 219 10.1 # include 219A A 10.2 # define 221A A 10.3 Macros 222A A 10.4 # undef 225A A 10.5 # if... 226A A 10.6 # line 232A A 10.7 Predefined macros 233A A 10.8 # error 233A A 10.9 # pragma 234A A 10.10 Exercises 234 11 Data aggregates 237 11.1 Structures 237A A 11.1.1 Vectors of structures 241A A 11.1.2 Pointers to structures 243A A 11.1.3 Structure variables as components of structures 246A A 11.1.4 Pointers as components of structures 248A A 11.2 Variants 250A A 11.3 Enumerations 254A A 11.4 Bit-fields 258A A 11.5 typedef 262A A 11.6 Exercises 265 12 Standard functions 269 12.1 Functions for input/output: stdio.h 269A A 12.2 The string functions: string.h 271A A 12.2.1 size_t strlen (const char * s); 271A A 12.2.2 char * strcpy (char * t, const char * s); 272A A 12.2.3 char * strcat (char * t, const char * s); 272A A