An edition of C How to Program (2007)

C How to Program, 9/e

C How to Program with Case Studies Introducing Application Programming and Systems Programming

Ninth Edition
  • 36 Want to read
  • 6 Have read
Locate

My Reading Lists:

Create a new list

  • 36 Want to read
  • 6 Have read

Buy this book

Last edited by hi720tu
February 25, 2026 | History
An edition of C How to Program (2007)

C How to Program, 9/e

C How to Program with Case Studies Introducing Application Programming and Systems Programming

Ninth Edition
  • 36 Want to read
  • 6 Have read

C How to Program is a user-friendly, code-intensive introduction to C programming with case studies introducing applications and system programming. Like other texts of the Deitels' How to Program series, the book's modular presentation serves as a detailed beginner source of information for college students looking to embark on a career in coding, or instructors and software-development professionals seeking to learn how to program with C. The signature Deitel live-code approach presents concepts in the context of 142 full-working programs rather than incomplete snips of code. This gives you a chance to run each program as you study it and see how your learning applies to real-world programming scenarios.
Current standards, contemporary practice, and hands-on learning opportunities are integrated throughout the 9th Edition. Over 340 new integrated Self-Check exercises with answers allow you to test your understanding of important concepts, and check your code, as you read. New and enhanced case studies and exercises use real-world data and focus on the latest ACM/IEEE computing curricula recommendations, highlighting security, data science, ethics, privacy, and performance concepts.

Publish Date
Publisher
Pearson

Buy this book

Previews available in: English

Edition Availability
Cover of: C How to Program, 9/e
Cover of: C
C: How to Program
2016, Pearson
in English
Cover of: C How to Program
C How to Program
2013, Pearson
in English - Seventh International Edition
Cover of: C
C: How to Program
2013, PHI
in English
Cover of: C
C: how to program
2012, Pearson
in English - Seventh edition.
Cover of: C
C: how to program
2010, Pearson Prentice Hall
in English - 6th ed.
Cover of: C
C: how to program
2010, Pearson Prentice Hall
in English - 6th ed.
Cover of: C
C: how to program
2010, PHI Learning Private Limited
in English
Cover of: C how to program
C how to program
2007, Pearson Prentice Hall
in English - 5th ed.

Add another edition?

Book Details


First Sentence

"Welcome to C—one of the world’s most senior computer programming languages and, according to the Tiobe Index, the world’s most popular.1 You’re probably famil- iar with many of the powerful tasks computers perform. In this textbook, you’ll get intensive, hands-on experience writing C instructions that command computers to perform those and other tasks. Software (that is, the C instructions you write, which are also called code) controls hardware (that is, computers and related devices)."

Table of Contents

Preface. vii
Before You Begin. xviv
Chapter 1. Introduction to Computers and C
Page 1
1.1. Introduction
Page 2
1.2. Hardware and Software
Page 4
1.2.1. Moore’s Law
Page 4
1.2.2. Computer Organization
Page 5
1.3. Data Hierarchy
Page 8
1.4. Machine Languages, Assembly Languages and High-Level Languages
Page 11
1.5. Operating Systems
Page 13
1.6. The C Programming Language
Page 16
1.7. The C Standard Library and Open-Source Libraries
Page 18
1.8. Other Popular Programming Languages
Page 19
1.9. Typical C Program-Development Environment
Page 21
1.9.1. Phase 1: Creating a Program
Page 21
1.9.2. Phases 2 and 3: Preprocessing and Compiling a C Program
Page 21
1.9.3. Phase 4: Linking
Page 22
1.9.4. Phase 5: Loading
Page 23
1.9.5. Phase 6: Execution
Page 23
1.9.6. Problems That May Occur at Execution Time
Page 23
1.9.7. Standard Input, Standard Output and Standard Error Streams
Page 24
1.10. Test-Driving a C Application in Windows, Linux and macOS
Page 24
1.10.1. Visual Studio 2019 on Windows 10
Page 25
1.10.2. Xcode on macOS
Page 29
1.10.3. GNU gcc on Linux
Page 32
1.10.4. GCC Docker Container
Page 34
1.11. Internet, World Wide Web, the Cloud and IoT
Page 35
1.11.1. The Internet: A Network of Networks
Page 36
1.11.2. The World Wide Web
Page 37
1.11.3. The Cloud
Page 37
1.11.4. The Internet of Things
Page 38
1.12. Software Technologies
Page 39
1.13. How Big Is Big Data?
Page 39
1.13.1. Big-Data Analytics
Page 45
1.13.2. Data Science Use Cases
Page 46
1.14. Case Study—A Big-Data Mobile Application
Page 47
1.15. AI—at the Intersection of CS and Data Science
Page 48
Chapter 2. Intro to C Programming
Page 55
2.1. Introduction
Page 56
2.2. Printing a Line of Text
Page 56
2.3. Adding Two Integers
Page 60
2.4. Memory Concepts
Page 64
2.5. Arithmetic in C
Page 65
2.6. Equality and Relational Operators
Page 69
2.7. Secure C Programming
Page 73
Chapter 3. Structured Program Development
Page 85
3.1. Introduction
Page 86
3.2. Algorithms
Page 86
3.3. Pseudocode
Page 87
3.4. Control Structures
Page 88
3.5. if Statement
Page 90
3.6. if…else Statement
Page 92
3.7. while Statement
Page 96
3.8. Case Study 1: Counter-Controlled Iteration
Page 97
3.9. Case Study 2: Sentinel-Controlled Iteration
Page 99
3.10. Case Study 3: Nested Control Statements
Page 106
3.11. Assignment Operators
Page 110
3.12. Increment and Decrement Operators
Page 111
3.13. Secure C Programming
Page 114
Chapter 4. Program Control
Page 133
4.1. Introduction
Page 134
4.2. Iteration Essentials
Page 134
4.3. Counter-Controlled Iteration
Page 135
4.4. for Iteration Statement
Page 136
4.5. Examples Using the for Statement
Page 140
4.6. switch Multiple-Selection Statement
Page 144
4.7. do…while Iteration Statement
Page 150
4.8. break and continue Statements
Page 151
4.9. Logical Operators
Page 153
4.10. Equality (==) vs Assignment (=)
Page 157
4.11. Structured-Programming Summary
Page 158
4.12. Secure C Programming
Page 163
Chapter 5. Functions
Page 179
5.1. Introduction
Page 180
5.2. Modularizing Programs in C
Page 180
5.3. Math Library Functions
Page 182
5.4. Functions
Page 183
5.5. Function Definitions
Page 184
5.5.1. square Function
Page 184
5.5.2. maximum Function
Page 187
5.6. Function Prototypes
Page 188
5.7. Function-Call Stack and Stack Frames
Page 191
5.8. Headers
Page 195
5.9. Passing Arguments by Value and Reference
Page 197
5.10. Random-Number Generation
Page 197
5.11. Casino Game Case Study
Page 202
5.12. Storage Classes
Page 207
5.13. Scope Rules
Page 209
5.14. Recursion
Page 212
5.15. Fibonacci Series
Page 216
5.16. Recursion vs Iteration
Page 219
5.17. Secure Random-Number Generation
Page 222
Case Study. The Tortoise and the Hare
Page 241
Chapter 6. Arrays
Page 243
6.1. Introduction
Page 244
6.2. Arrays
Page 244
6.3. Defining Arrays
Page 246
6.4. Array Examples
Page 246
6.4.1. Loop Initialization
Page 247
6.4.2. Initializer Lists
Page 248
6.4.3. Symbolic Constants
Page 249
6.4.4. Summing Elements
Page 250
6.4.5. Survey Results
Page 250
6.4.6. Bar Charts
Page 252
6.4.7. 60,000,000 Dice Rolls
Page 253
6.5. Character Arrays and Strings
Page 255
6.5.1. String Initialization
Page 255
6.5.2. Initializer List of Characters
Page 255
6.5.3. Accessing Characters
Page 255
6.5.4. Input into Character Array
Page 255
6.5.5. Outputting Strings
Page 256
6.5.6. Demonstrations
Page 256
6.6. Static vs Automatic Local Arrays
Page 258
6.7. Passing Arrays to Functions
Page 260
6.8. Sorting Arrays
Page 264
6.9. Survey Data Analysis Case Study
Page 267
6.10. Searching Arrays
Page 272
6.10.1. Linear Search
Page 272
6.10.2. Binary Search
Page 274
6.11. Multidimensional Arrays
Page 278
6.11.1. Two-Dimensional Arrays
Page 278
6.11.2. Initialization
Page 279
6.11.3. Setting One Row
Page 281
6.11.4. Totaling Elements
Page 281
6.11.5. Manipulations
Page 281
6.12. Variable-Length Arrays
Page 285
6.13. Secure C Programming
Page 289
Chapter 7. Pointers
Page 309
7.1. Introduction
Page 310
7.2. Pointer Definitions and Initialization
Page 311
7.3. Pointer Operators
Page 312
7.4. Pass by Reference
Page 315
7.5. const with Pointers
Page 319
7.5.1. Uppercase Conversion
Page 320
7.5.2. Printing Character by Character
Page 320
7.5.3. Modifying Constant Pointer
Page 322
7.5.4. Constant Pointer to Constant Data
Page 323
7.6. Bubble Sort with References
Page 324
7.7. sizeof Operator
Page 328
7.8. Pointer Arithmetic
Page 330
7.9. Pointers and Arrays
Page 333
7.10. Arrays of Pointers
Page 338
7.11. Card Shuffling Case Study
Page 339
7.12. Function Pointers
Page 344
7.13. Secure C Programming
Page 349
Chapter 8. Characters and Strings
Page 387
8.1. Introduction
Page 388
8.2. Fundamentals of Strings and Characters
Page 388
8.3. Character-Handling Library
Page 390
8.3.1. Functions isdigit, isalpha, isalnum and isxdigit
Page 391
8.3.2. Functions islower, isupper, tolower and toupper
Page 393
8.3.3. Functions isspace, iscntrl, ispunct, isprint and isgraph
Page 394
8.4. String-Conversion Functions
Page 396
8.4.1. Function strtod
Page 396
8.4.2. Function strtol
Page 397
8.4.3. Function strtoul
Page 398
8.5. Standard Input/Output Library Functions
Page 399
8.5.1. Functions fgets and putchar
Page 399
8.5.2. Function getchar
Page 401
8.5.3. Function sprintf
Page 401
8.5.4. Function sscanf
Page 402
8.6. String-Manipulation Functions
Page 403
8.6.1. Functions strcpy and strncpy
Page 404
8.6.2. Functions strcat and strncat
Page 405
8.7. Comparison Functions
Page 406
8.8. Search Functions
Page 408
8.8.1. Function strchr
Page 409
8.8.2. Function strcspn
Page 410
8.8.3. Function strpbrk
Page 410
8.8.4. Function strrchr
Page 411
8.8.5. Function strspn
Page 411
8.8.6. Function strstr
Page 412
8.8.7. Function strtok
Page 413
8.9. Memory Functions
Page 414
8.9.1. Function memcpy
Page 415
8.9.2. Function memmove
Page 416
8.9.3. Function memcmp
Page 416
8.9.4. Function memchr
Page 417
8.9.5. Function memset
Page 417
8.10. Other String-Handling Functions
Page 419
8.10.1. Function strerror
Page 419
8.10.2. Function strlen
Page 419
8.11. Secure C Programming
Page 420
Case Study. Public-Key Cryptography
Page 404
Chapter 9. Formatted Input/Output
Page 449
9.1. Introduction
Page 450
9.2. Streams
Page 450
9.3. Formatting Output with printf
Page 451
9.4. Printing Integers
Page 452
9.5. Printing Floating-Point Numbers
Page 453
9.5.1. Conversion Specifiers e, E and f
Page 454
9.5.2. Conversion Specifiers g and G
Page 454
9.5.3. Demonstrating Floating-Point Conversion Specifiers
Page 455
9.6. Printing Strings and Characters
Page 456
9.7. Other Conversion Specifiers
Page 457
9.8. Field Widths and Precision
Page 458
9.8.1. Field Widths for Integers
Page 458
9.8.2. Precision for Integers, Floating-Point Numbers and Strings
Page 459
9.8.3. Combining Width and Precision
Page 460
9.9. printf Format Flags
Page 461
9.9.1. Alignment
Page 461
9.9.2. + Flag
Page 462
9.9.3. Space Flag
Page 462
9.9.4. # Flag
Page 463
9.9.5. 0 Flag
Page 463
9.10. Literals and Escape Sequences
Page 464
9.11. Formatted Input with scanf
Page 465
9.11.1. scanf Syntax
Page 466
9.11.2. scanf Conversion Specifiers
Page 466
9.11.3. Reading Integers
Page 467
9.11.4. Reading Floating-Point Numbers
Page 468
9.11.5. Reading Characters and Strings
Page 468
9.11.6. Scan Sets
Page 469
9.11.7. Field Widths
Page 470
9.11.8. Skipping Characters
Page 471
9.12. Secure C Programming
Page 472
Chapter 10. Structures, Unions, Bit Manipulation and Enumerations
Page 481
10.1. Introduction
Page 482
10.2. Structure Definitions
Page 483
10.2.1. Self-Referential Structures
Page 483
10.2.2. Defining Variables
Page 484
10.2.3. Structure Tag Names
Page 484
10.2.4. Structure Operations
Page 484
10.3. Initializing Structures
Page 486
10.4. Accessing Members (. and ->)
Page 486
10.5. Structures with Functions
Page 488
10.6. typedef
Page 488
10.7. High-Performance Card Shuffling
Page 489
10.8. Unions
Page 492
10.8.1. union Declarations
Page 493
10.8.2. Allowed Operations
Page 493
10.8.3. Initializing unions
Page 493
10.8.4. Demonstrating unions
Page 494
10.9. Bitwise Operators
Page 495
10.9.1. Displaying Bits
Page 496
10.9.2. Generic displayBits
Page 497
10.9.3. AND, OR, XOR, Complement
Page 498
10.9.4. Shift Operators
Page 501
10.9.5. Bitwise Assignment
Page 503
10.10. Bit Fields
Page 504
10.10.1. Defining Bit Fields
Page 504
10.10.2. Representing Card Attributes
Page 505
10.10.3. Unnamed Bit Fields
Page 507
10.11. Enumeration Constants
Page 507
10.12. Anonymous Structures and Unions
Page 509
10.13. Secure C Programming
Page 510
Chapter 11. File Processing
Page 539
11.1. Introduction
Page 540
11.2. Files and Streams
Page 540
11.3. Creating a Sequential-Access File
Page 542
11.3.1. Pointer to a FILE
Page 543
11.3.2. Using fopen to Open a File
Page 543
11.3.3. Using feof to Check for End-of-File
Page 543
11.3.4. Using fprintf to Write to a File
Page 544
11.3.5. Using fclose to Close a File
Page 544
11.3.6. File-Open Modes
Page 545
11.4. Reading Data from a Sequential-Access File
Page 547
11.4.1. Resetting the File Position Pointer
Page 548
11.4.2. Credit Inquiry Program
Page 548
11.5. Random-Access Files
Page 552
11.6. Creating a Random-Access File
Page 553
11.7. Writing Data Randomly to a Random-Access File
Page 555
11.7.1. Positioning with fseek
Page 557
11.7.2. Error Checking
Page 558
11.8. Reading Data from a Random-Access File
Page 558
11.9. Case Study: Transaction-Processing System
Page 560
11.10. Secure C Programming
Page 566
Case Study. Intro to NLP—Who Wrote Shakespeare’s Works?
Page 576
Case Study. Machine Learning with GNU Scientific Library
Page 582
Case Study. Time Series and Simple Linear Regression
Page 588
Case Study. Web Services and the Cloud—libcurl and OpenWeatherMap
Page 589
Chapter 12. Data Structures
Page 595
12.1. Introduction
Page 596
12.2. Self-Referential Structures
Page 597
12.3. Dynamic Memory Management
Page 598
12.4. Linked Lists
Page 599
12.4.1. Function insert
Page 603
12.4.2. Function delete
Page 605
12.4.3. Functions isEmpty and printList
Page 607
12.5. Stacks
Page 608
12.5.1. Function push
Page 612
12.5.2. Function pop
Page 613
12.5.3. Applications of Stacks
Page 613
12.6. Queues
Page 614
12.6.1. Function enqueue
Page 619
12.6.2. Function dequeue
Page 620
12.7. Trees
Page 621
12.7.1. Function insertNode
Page 624
12.7.2. Traversals: inOrder, preOrder, postOrder
Page 625
12.7.3. Duplicate Elimination
Page 626
12.7.4. Binary Tree Search
Page 626
12.7.5. Other Binary Tree Operations
Page 626
12.8. Secure C Programming
Page 627
Special Section. Systems Software Case Study—Building Your Own Compiler
Page 636
Chapter 13. Sorting Algorithms and Big O
Page 657
13.1. Introduction
Page 658
13.2. Efficiency of Algorithms: Big O
Page 659
13.2.1. O(1) Algorithms
Page 659
13.2.2. O(n) Algorithms
Page 659
13.2.3. O(n²) Algorithms
Page 659
13.3. Selection Sort
Page 660
13.3.1. Implementation
Page 661
13.3.2. Efficiency
Page 664
13.4. Insertion Sort
Page 665
13.4.1. Implementation
Page 665
13.4.2. Efficiency
Page 668
13.5. Case Study: Merge Sort
Page 668
13.5.1. Implementation
Page 669
13.5.2. Efficiency
Page 673
13.5.3. Comparing Big O Notations
Page 674
Chapter 14. Preprocessor
Page 681
14.1. Introduction
Page 682
14.2. #include Directive
Page 683
14.3. #define: Symbolic Constants
Page 683
14.4. #define: Macros
Page 684
14.4.1. Macro with One Argument
Page 685
14.4.2. Macro with Two Arguments
Page 686
14.4.3. Macro Continuation Character
Page 686
14.4.4. #undef Directive
Page 686
14.4.5. Standard-Library Macros
Page 686
14.4.6. Side Effects in Macros
Page 687
14.5. Conditional Compilation
Page 687
14.5.1. #if…#endif
Page 687
14.5.2. Commenting Code with #if
Page 688
14.5.3. Debug Code Compilation
Page 688
14.6. #error and #pragma
Page 689
14.7. # and ## Operators
Page 690
14.8. Line Numbers
Page 690
14.9. Predefined Symbolic Constants
Page 691
14.10. Assertions
Page 691
14.11. Secure C Programming
Page 692
Chapter 15. Other Topics
Page 699
15.1. Introduction
Page 700
15.2. Variable-Length Argument Lists
Page 700
15.3. Command-Line Arguments
Page 702
15.4. Compiling Multiple-Source Programs
Page 704
15.4.1. extern Declarations
Page 704
15.4.2. Function Prototypes
Page 705
15.4.3. Restricting Scope with static
Page 705
15.5. exit and atexit
Page 706
15.6. Literal Suffixes
Page 708
15.7. Signal Handling
Page 708
15.8. calloc and realloc
Page 711
15.9. goto
Page 713
Appendix A. Operator Precedence Chart
Page 719
Appendix B. ASCII Character Set
Page 721
Appendix C. Multithreading/Multicore and C18/C11/C99 Topics
Page 723
C.1. Introduction
Page 724
C.2. Headers Added in C99
Page 725
C.3. Designated Initializers and Compound Literals
Page 725
C.4. Type bool
Page 727
C.5. Complex Numbers
Page 728
C.6. Macros with Variable-Length Arguments
Page 730
C.7. Other C99 Features
Page 730
C.7.1. Compiler Resource Limits
Page 730
C.7.2. restrict Keyword
Page 730
C.7.3. Reliable Integer Division
Page 731
C.7.4. Flexible Array Members
Page 731
C.7.5. Type-Generic Math
Page 732
C.7.6. Inline Functions
Page 732
C.7.7. func Identifier
Page 732
C.7.8. va_copy Macro
Page 733
C.8. C11/C18 Features
Page 733
C.8.1. C11/C18 Headers
Page 733
C.8.2. quick_exit Function
Page 733
C.8.3. Unicode Support
Page 733
C.8.4. _Noreturn Specifier
Page 734
C.8.5. Type-Generic Expressions
Page 734
C.8.6. Annex L: Undefined Behavior
Page 734
C.8.7. Memory Alignment Control
Page 735
C.8.8. Static Assertions
Page 735
C.8.9. Floating-Point Types
Page 735
C.9. Multithreading Performance Case Study
Page 736
C.9.1. Sequential Execution Example
Page 739
C.9.2. Multithreaded Execution Example
Page 741
C.9.3. Other Multithreading Features
Page 745
Appendix D. Intro to Object-Oriented Programming Concepts
Page 747
D.1. Introduction
Page 747
D.2. OOP Languages
Page 747
D.3. Automobile as an Object
Page 748
D.4. Methods and Classes
Page 748
D.5. Instantiation
Page 748
D.6. Reuse
Page 748
D.7. Messages and Method Calls
Page 749
D.8. Attributes and Instance Variables
Page 749
D.9. Inheritance
Page 749
D.10. OOAD
Page 750
Index. 751

Edition Notes

Other Titles
C How to Program, 9th Edition
Copyright Date
2022

The Physical Object

Format
paperback
Pagination
838

Edition Identifiers

Open Library
OL40226524M
ISBN 10
0135404673
ISBN 13
9780137398393

Work Identifiers

Work ID
OL7943173W

Source records

Community Reviews (0)

No community reviews have been submitted for this work.

Lists

Download catalog record: RDF / JSON / OPDS | Wikipedia citation