You are previewing C Programming for the Absolute Beginner, Third Edition.
O'Reilly logo
C Programming for the Absolute Beginner, Third Edition

Book Description

Are you an aspiring computer programmer? C PROGRAMMING FOR THE ABSOLUTE BEGINNER will teach you fundamental computer programming skills in this powerful programming language-and no previous experience is required. This fun and friendly guide will lead you, step-by-step, through C programming with clear explanations and plenty of examples and illustrations. Each chapter includes a simple, fully functional game project that will test your new programming knowledge and let you put your skills to work. Helpful appendixes feature reference material such as common C library functions, common UNIX commands, and more. The C compiler used throughout the book is available as a free download. The best way to learn programming is by doing. Start programming today with C PROGRAMMING FOR THE ABSOLUTE BEGINNER.

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Dedication
  4. Acknowledgments
  5. About the Authors
  6. Table of Contents
  7. Introduction
  8. 1 Getting Started with C Programming
    1. Installing and Configuring the Cygwin Environment
    2. Understanding the main() Function
    3. Using Comments
    4. Understanding Keywords
    5. Working with Program Statements
    6. Using Directives
    7. Creating and Running Your First C Program
    8. Debugging C Programs
    9. Summary
  9. 2 Primary Data Types
    1. Exploring Memory Concepts
    2. Understanding Data Types
    3. Initializing Variables and the Assignment Operator
    4. Printing Variable Contents
    5. Using Conversion Specifiers
    6. Understanding Constants
    7. Using Programming Conventions and Styles
    8. Doing Arithmetic in C
    9. Understanding Operator Precedence
    10. Chapter Program: Shop Profit
    11. Summary
  10. 3 Conditions
    1. Algorithms for Conditions
    2. Simple if Structures
    3. Nested if Structures
    4. Introduction to Boolean Algebra
    5. Compound if Structures and Input Validation
    6. The switch Structure
    7. Random Numbers
    8. Chapter Program: Fortune Cookie
    9. Summary
  11. 4 Looping Structures
    1. Pseudocode for Loops
    2. Flowcharts for Loops
    3. Additional Operators
    4. The while Loop
    5. The do while Loop
    6. The for Loop
    7. break and continue Statements
    8. System Calls
    9. Chapter Program: Concentration
    10. Summary
  12. 5 Structured Programming
    1. Introduction to Structured Programming
    2. Function Prototypes
    3. Function Definitions
    4. Function Calls
    5. Variable Scope
    6. Chapter Program: Trivia
    7. Summary
  13. 6 Arrays
    1. Introduction to Arrays
    2. One-Dimensional Arrays
    3. Two-Dimensional Arrays
    4. Chapter Program: Tic-Tac-Toe
    5. Summary
  14. 7 Pointers
    1. Pointer Fundamentals
    2. Functions and Pointers
    3. Passing Arrays to Functions
    4. The const Qualifier
    5. Chapter Program: Cryptogram
    6. Summary
  15. 8 Strings
    1. Introduction to Strings
    2. Reading and Printing Strings
    3. String Arrays
    4. Converting Strings to Numbers
    5. Manipulating Strings
    6. Analyzing Strings
    7. Chapter Program: Word Find
    8. Summary
  16. 9 Introduction to Data Structures
    1. Structures
    2. Structures and Functions
    3. Unions
    4. Typecasting
    5. Chapter Program: Card Shuffle
    6. Summary
  17. 10 Dynamic Memory Allocation
    1. Dynamic Memory Concepts
    2. The sizeof Operator
    3. The malloc() Function
    4. The calloc() and realloc() Functions
    5. Chapter Program: Math Quiz
    6. Summary
  18. 11 File Input and Output
    1. Introduction to Data Files
    2. Bits and Bytes
    3. File Streams
    4. goto and Error Handling
    5. Chapter Program: Character Roster
    6. Summary
  19. 12 The C Preprocessor
    1. Understanding the C Preprocessor
    2. Building Larger Programs
    3. Chapter Program: The Function Wizard
    4. Summary
    5. What’s Next?
  20. A Common UNIX Commands
  21. B Vim Quick Guide
  22. C nano Quick Guide
  23. D TCC Quick Guide
    1. Installing and Configuring TCC for Windows
    2. Creating, Compiling, and Executing Code
  24. E ASCII Character Codes
  25. F Common C Library Functions
  26. Index