Cover
Preface
Brief Contents
Contents
1 - Introducing C
1.1 - History of C
1.2 - Strengths and Weaknesses of C
1 - Q & A
2 - C Fundamentals
2.1 - Writing a Simple Program
2.2 - The General Form of a Simple Program
2.3 - Comments
2.4 - Variables and Assignment
2.5 - Reading Input
2.6 - Defining Names for Constants
2.7 - Identifiers
2.8 - Layout of a C Program
2 - Q & A
2 - Exercises
2 - Programming Projects
3 - Formatted Input/Output
3.1 - The printf Function
3.2 - The scanf Function
3 - Q & A
3 - Excercises
3 - Programming Projects
4 - Expressions
4.1 - Arithmetic Operators
4.2 - Assignment Operators
4.3 - Increment and Decrement Operators
4.4 - Expression Evaluation
4.5 - Expression Statements
4 - Q & A
4 - Exercises
4 - Programming Projects
5 - Selection Statements
5.1 - Logical Expressions
5.2 - The if Statement
5.3 - The switch Statement
5 - Q & A
5 - Exercises
5 - Programming Projects
6 - Loops
6.1 - The while Statement
6.2 - The do Statement
6.3 - The for Statement
6.4 - Exiting from a Loop
6.5 - The Null Statement
6 - Q & A
6 - Exercises
6 - Programming Projects
7 - Basic Types
7.1 - Integer Types
7.2 - Floating Types
7.3 - Character Types
7.4 - Type Conversion
7.5 - Type Definitions
7.6 - The sizeof Operator
7 - Q & A
7 - Exercises
7 - Programming Projects
8 - Arrays
8.1 - One-Dimensional Arrays
8.2 - Multidimensional Arrays
8.3 - Variable-Length Arrays (C99)
8 - Q & A
8 - Exercises
8 - Programming Projects
9 - Functions
9.1 - Defining and Calling Functions
9.2 - Function Declarations
9.3 - Arguments
9.4 - The return Statement
9.5 - Program Termination
9.6 - Recursion
9 - Q & A
9 - Exercises
9 - Programming Projects
10 - Program Organization
10.1 - Local Variables
10.2 - External Variables
10.3 - Blocks
10.4 - Scope
10.5 - Organizing a C Program
10 - Q & A
10 - Exercises
10 - Programming Projects
11 - Pointers
11.1 - Pointers
11.2 - The Address and Indirection Operators
11.3 - Pointer Assignment
11.4 - Pointers as Arguments
11.5 - Pointers as Return Values
11 - Q & A
11 - Exercises
12 - Pointers and Arrays
12.1 - Pointer Arithmetic
12.2 - Using Pointers for Array Processing
12.3 - Using an Array Name as a Pointer
12.4 - Pointers and Multidimensional Arrays
12.5 - Pointers and Variable-Length Arrays (C99)
12 - Q & A
12 - Exercises
12 - Programming Projects
13 - Strings
13.1 - String Literals
13.2 - String Variables
13.3 - Reading and Writing Strings
13.4 - Accessing the Characters in a String
13.5 - Using the C String Library
13.6 - String Idioms
13.7 - Arrays of Strings
13 - Q & A
13 - Exercises
13 - Programming Projects
14 - The Preprocessor
14.1 - How the Preprocessor Works
14.2 - Preprocessing Directives
14.3 - Macro Definitions
14.4 - Conditional Compilation
14.5 - Miscellaneous Directives
14 - Q & A
14 - Exercises
15 - Writing Large Programs
15.1 - Source Files
15.2 - Header Files
15.3 - Dividing a Program into Files
15.4 - Building a Multiple-File Program
15 - Q & A
15 - Exercises
15 - Programming Projects
16 - Structures, Unions, and Enumerations
16.1 - Structure Variables
16.2 - Structure Types
16.3 - Nested Arrays and Structures
16.4 - Unions
16.5 - Enumerations
16 - Q & A
16 - Exercises
16 - Programming Projects
17 - Advanced Uses of Pointers
17.1 - Dynamic Storage Allocation
17.2 - Dynamically Allocated Strings
17.3 - Dynamically Allocated Arrays
17.4 - Deallocating Storage
17.5 - Linked Lists
17.6 - Pointers to Pointers
17.7 - Pointers to Functions
17.8 - Restricted Pointers (C99)
17.9 - Flexible Array Members (C99)
17 - Q & A
17 - Exercises
17 - Programming Projects
18 - Declarations
18.1 - Declaration Syntax
18.2 - Storage Classes
18.3 - Type Qualifiers
18.4 - Declarators
18.5 - Initializers
18.6 - Inline Functions (C99)
18 - Q & A
18 - Exercises
19 - Program Design
19.1 - Modules
19.2 - Information Hiding
19.3 - Abstract Data Types
19.4 - A Stack Abstract Data
19.5 - Design Issues for Abstract Data Types
19 - Q & A
19 - Exercises
19 - Programming Projects
20 - Low-Level Programming
20.1 - Bitwise Operators
20.2 - Bit-Fields in Structures
20.3 - Other Low-Level Techniques
20 - Q & A
20 - Exercises
20 - Programming Projects
21 - The Standard Library
21.1 - Using the Library
21.2 - C89 Library Overview
21.3 - C99 Library Changes
21.5 - The
Header (C99: Boolean Type and Values
21 - Q & A
21 - Exercises
21 - Programming Projects
22 - Input/Output
22.1 - Streams
22.2 - File Operations
22.3 - Formatted I/O
22.4 - Character I/O
22.5 - Line I/O
22.6 - Block I/O
22.7 - File Provisioning
22.8 - String I/O
22 - Q & A
22 - Exercises
22 - Programming Projects
23 - Library Support for Numbers and Character Data
23.1 - The Header: Characteristics of Floating Types
23.2 - The Header: Sizes of Integer Types
22.3 - The Header (C89): Mathematics
23.4 - The Header (C99): Mathematics
23.5 - The Header: Character Handling
23.6 - The Header: String Handling
23 - Q & A
23 - Exercises
23 - Programming Projects
24 - Error Handling
24.1 - The Header: Diagnostics
24.2 - The Header: Errors
24.3 - The Header: Signal Handling
24.4 - The Header: Nonlocal Jumps
24 - Q & A
24 - Exercises
25 - International Features
25.1 - The Header: Localization
25.2 - Multibyte Characters and Wide Characters
25.3 - Diagraphs and Trigraphs
25.4 - Universal Character Names (C99)
25.5 - The Header (C99) Extended Multibyte and Wide-Character Utilities
25.6 - The Header (C99) Wide-Character Classification and Mapping Utilities
25 - Q & A
25 - Exercises
25 - Programming Projects
26 - Miscellaneous Library Functions
26.1 - The Header: Variable Arguments
26.2 - The Header: General Utilities
26.3 - The Header: Date and Time
26 - Q & A
26 - Exercises
26 - Programming Projects
27 - Additional C99 Support for Mathematics
27.1 - The Header (C99): Integer Types
27.2 - The Header (C99) Format Conversion of Integer Types
27.3 - Complex Numbers (C99)
27.4 - The Header (C99): Complex Arithmetic
27.5 - The Header (C99): Type-Generic Math
27.6 - The Header (C99): Floating-Point Environment
27 - Q & A
27 - Exercises
27 - Programming Projects
Appendix A - C Operators
Appendix B - C99 versus C89
Appendix C - C89 versus K&R C
Appendix D - Standard Library Functions
Appendix E - ASCII Character Sheet
Bibliography