0%

Book Description

It's no secret: When it comes to learning a programming language, Larry Ullman is the man you want at your side! As the best-selling author of guides to PHP, MySQL, and more, he's proved that programming doesn't have to be painful, especially when it comes to a language that is at its core both simple and small. We're talking, of course, about C, and if you want to learn it fast (not to mention well), this book provides the key. Joined by co-author and fellow programmer Marc Liyanage, this author team tackles both programming fundamentals and the ABCs of C itself through a series of task-based lessons that use step-by-step instructions and a plethora of visual aids to make C if not instantly accessible, then almost. This book uses friendly, straightforward language to explain every aspect of this fundamental technology: from basic syntax and data types to working with numbers, characters, loops, and arrays; creating functions; using the C preprocessor; file input and output; and more.

Table of Contents

  1. Copyright
  2. Acknowledgements
  3. Introduction
  4. Getting Started with C
    1. Basic Syntax
    2. Printing Text
    3. Compiling and Running C
    4. To compile and run C using an IDE
    5. Keeping Your Application Open
    6. Adding Comments to Your Source Code
    7. Understanding White Space
  5. Introduction to Data Types
    1. Proper Variable Syntax
    2. Assigning Values to Variables
    3. Printing Variables
    4. Introduction to Characters
    5. Using Character Strings
    6. Introduction to Constants
  6. Working with Numbers
    1. Selecting a Number Type
    2. Performing Arithmetic
    3. Increment and Decrement Operators
    4. Understanding Precedence
    5. Understanding Overflow and Underflow
    6. Variable Conversion
  7. Control Structures
    1. If Statements
    2. Comparison And Logical Operators
    3. Using Else and Else If
    4. The Ternary Operator
    5. The Switch Conditional
    6. The While Loop
    7. The For Loop
  8. Standard Input and Output
    1. Inputting a Single Character
    2. Retrieving Whole Word Input
    3. Reading Numeric Input
    4. Reading Multiple Inputs
    5. Validating Keyboard Input
    6. Advanced printf() Usage
  9. Working with Arrays
    1. Introduction to Arrays
    2. Assigning Values to Arrays
    3. Accessing Array Values
    4. Defining Arrays Using Constants
    5. Looping through Arrays
    6. Using Character Arrays
    7. Using Multidimensional Arrays
  10. Creating Your Own Functions
    1. Creating Simple Functions
    2. Creating Functions That Take Arguments
    3. Creating Functions That Return a Value
    4. Creating Inline Functions
    5. Using Recursion
    6. Understanding Variable Scope
  11. Using the C Preprocessor
    1. Introduction to the C Preprocessor
    2. Using Constants
    3. Function-like Macros
    4. Function-like Macros That Take Arguments
    5. Creating and Including Header Files
    6. Including Header Files
    7. Creating Conditionals
  12. Working with Pointers
    1. Understanding Program Memory
    2. The Address-of Operator
    3. Storing and Retrieving Addresses in Pointer Variables
    4. Another Look at Pointer Variables
    5. Dereferencing Pointer Variables
    6. Passing Addresses to Functions
    7. Arrays, Pointers, and Pointer Arithmetic
    8. Arrays of Pointers
  13. Managing Memory
    1. Static and Dynamic Memory
    2. Type Casts
    3. Allocating Arrays of Dynamic Size
    4. Resizing a Block of Memory
    5. Returning Memory from a Function
    6. Avoiding Memory Leaks
  14. Working with Strings
    1. Basic String Pointer Syntax
    2. Finding the Length of a String
    3. Connecting Strings (Concatenation)
    4. Comparing Strings
    5. Copying Strings
    6. Sorting Strings
  15. File Input and Output
    1. Opening and Closing Files
    2. Writing to Files
    3. Reading from Files
    4. Parsing File Input
    5. Writing to Binary Files
    6. Reading from Binary Files
    7. Moving Around Within Binary Files
  16. Advanced Data Types
    1. Introduction to Structures
    2. Using typedef
    3. Using Arrays of Structures
    4. Introduction to Linked Lists
  17. Installing and Using C Tools
    1. Dev-C++ for Windows
    2. Xcode on Mac OS X
    3. Unix Tools
    4. Debugging with GDB
    5. Other Tools
  18. Resources
    1. Web Sites
    2. Tables
  19. Index