You are previewing Beginning C: From Novice to Professional, Fourth Edition.
O'Reilly logo
Beginning C: From Novice to Professional, Fourth Edition

Book Description

With Beginning C: From Novice to Professional, Fourth Edition, you'll come to understand the fundamentals of the C language and learn how to program. All you need is this book and any one of the widely available free or commercial C or C++ compilers, and you'll soon be writing real C programs. You'll learn C from the first principles, using step-by-step working examples that you'll create and execute yourself.

This book will increase your programming expertise by guiding you through the development of fully working C applications that use what you've learned in a practical context. You'll also be able to strike out on your own by trying the exercises included at the end of each chapter. Pick up a copy of this book by renowned author, Ivor Horton, because:

  • It is the only beginning-level book to cover the latest ANSI standard in C

  • Is approachable and aimed squarely at people new to C

  • Emphasizes writing code after the first chapter

  • Includes substantial examples relevant to intermediate users

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. Acknowledgments
  7. Introduction
    1. How to Use This Book
    2. Who This Book Is For
    3. What You Need to Use This Book
    4. Conventions Used
    5. Code from the Book
  8. CHAPTER 1: Programming in C
    1. Creating C Programs
    2. Creating Your First Program
    3. Editing Your First Program
    4. Dealing with Errors
    5. Dissecting a Simple Program
    6. Developing Programs in C
    7. Functions and Modular Programming
    8. Common Mistakes
    9. Points to Remember
    10. Summary
    11. Exercises
  9. CHAPTER 2: First Steps in Programming
    1. Memory in Your Computer
    2. What Is a Variable?
    3. Variables That Store Numbers
    4. Variables and Memory
    5. Integer Variable Types
    6. Floating-Point Values
    7. Floating-Point Variables
    8. Division Using Floating-Point Values
    9. More Complicated Expressions
    10. Defining Constants
    11. Choosing the Correct Type for the Job
    12. Explicit Type Conversion
    13. More Numeric Data Types
    14. The op= Form of Assignment
    15. Mathematical Functions
    16. Designing a Program
    17. Summary
    18. Exercises
  10. CHAPTER 3: Making Decisions
    1. The Decision-Making Process
    2. Multiple-Choice Questions
    3. Bitwise Operators
    4. Designing a Program
    5. Summary
    6. Exercises
  11. CHAPTER 4: Loops
    1. How Loops Work
    2. Introducing the Increment and Decrement Operators
    3. The for Loop
    4. General Syntax of the for Loop
    5. More on the Increment and Decrement Operators
    6. The for Loop Revisited
    7. The while Loop
    8. Nested Loops
    9. Nested Loops and the goto Statement
    10. The do-while Loop
    11. The continue Statement
    12. Designing a Program
    13. Summary
    14. Exercises
  12. CHAPTER 5: Arrays
    1. An Introduction to Arrays
    2. A Reminder About Memory
    3. Arrays and Addresses
    4. Initializing an Array
    5. Finding the Size of an Array
    6. Multidimensional Arrays
    7. Initializing Multidimensional Arrays
    8. Designing a Program
    9. Summary
    10. Exercises
  13. CHAPTER 6: Applications with Strings and Text
    1. What Is a String?
    2. String- and Text-Handling Methods
    3. Operations with Strings
    4. String Library Functions
    5. Analyzing and Transforming Strings
    6. Working with Wide Character Strings
    7. Designing a Program
    8. Summary
    9. Exercises
  14. CHAPTER 7: Pointers
    1. A First Look at Pointers
    2. Arrays and Pointers
    3. Multidimensional Arrays
    4. Using Memory As You Go
    5. Handling Strings Using Pointers
    6. Designing a Program
    7. Summary
    8. Exercises
  15. CHAPTER 8: Structuring Your Programs
    1. Program Structure
    2. Functions
    3. The Pass-By-Value Mechanism
    4. Function Declarations
    5. Pointers As Arguments and Return Values
    6. Summary
    7. Exercises
  16. CHAPTER 9: More on Functions
    1. Pointers to Functions
    2. Variables in Functions
    3. Functions That Call Themselves: Recursion
    4. Functions with a Variable Number of Arguments
    5. The main() Function
    6. Ending a Program
    7. Libraries of Functions: Header Files
    8. Enhancing Performance
    9. Designing a Program
    10. Summary
    11. Exercises
  17. CHAPTER 10: Essential Input and Output Operations
    1. Input and Output Streams
    2. Standard Streams
    3. Input from the Keyboard
    4. Output to the Screen
    5. Other Output Functions
    6. Sending Output to the Printer
    7. Summary
    8. Exercises
  18. CHAPTER 11: Structuring Data
    1. Data Structures: Using struct
    2. More on Structure Members
    3. Structures and Functions
    4. Sharing Memory
    5. Defining Your Own Data Types
    6. Designing a Program
    7. Summary
    8. Exercises
  19. CHAPTER 12: Working with Files
    1. The Concept of a File
    2. Accessing Files
    3. Writing to a Text File
    4. Reading from a Text File
    5. Writing Strings to a Text File
    6. Reading Strings from a Text File
    7. Formatted File Input and Output
    8. Dealing with Errors
    9. Further Text File Operation Modes
    10. Binary File Input and Output
    11. Moving Around in a File
    12. Using Temporary Work Files
    13. Updating Binary Files
    14. File Open Modes Summary
    15. Designing a Program
    16. Summary
    17. Exercises
  20. CHAPTER 13: Supporting Facilities
    1. Preprocessing
    2. Logical Preprocessor Directives
    3. Debugging Methods
    4. Additional Library Functions
    5. Summary
    6. Exercises
  21. APPENDIX A: Computer Arithmetic
    1. Binary Numbers
    2. Hexadecimal Numbers
    3. Negative Binary Numbers
    4. Big-Endian and Little-Endian Systems
    5. Floating-Point Numbers
  22. APPENDIX B: ASCII Character Code Definitions
  23. APPENDIX C: Reserved Words in C
  24. APPENDIX D: Input and Output Format Specifications
    1. Output Format Specifications
    2. Input Format Specifications
  25. Index