Beginning C - From Beginner to Pro (6th Edition)

Learn how to program using C, beginning from first principles and progressing through step-by-step examples to become a competent, C-language programmer. All you need are this book and any of the widely available C compilers, and you'll soon be writing real C programs. You'll discover that...

Celý popis

Uloženo v:
Podrobná bibliografie
Hlavní autoři: Gonzalez-Morris, German, Horton, Ivor
Médium: E-kniha Kniha
Jazyk:angličtina
Vydáno: Berkeley, CA Apress, an imprint of Springer Nature 2020
Apress
Apress L. P
Vydání:6
Témata:
ISBN:1484259750, 9781484259757, 1484259769, 9781484259764
On-line přístup:Získat plný text
Tagy: Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
Obsah:
  • Title Page Introduction Table of Contents 1. Programming in C 2. First Steps in Programming 3. Making Decisions 4. Loops 5. Arrays 6. Applications with Strings and Text 7. Pointers 8. Structuring Your Programs 9. More on Functions 10. Essential Input and Output 11. Structuring Data 12. Working with Files 13. The Preprocessor and Debugging 14. Advanced and Specialized Topics Appendices Index
  • Character Input and Character Output -- Enumerations -- Choosing Enumerator Values -- Unnamed Enumeration Types -- Variables That Store Boolean Values -- The op= Form of Assignment -- Mathematical Functions -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Summary -- Chapter 3: Making Decisions -- The Decision-Making Process -- Arithmetic Comparisons -- The Basic if Statement -- Extending the if statement: if-else -- Using Blocks of Code in if Statements -- Nested if Statements -- Testing Characters -- Logical Operators -- The AND Operator &amp -- &amp -- -- The OR Operator || -- The NOT Operator ! -- The Conditional Operator -- Operator Precedence: Who Goes First? -- Multiple-Choice Questions -- Using else-if Statements for Multiple Choices -- The switch Statement -- The goto Statement -- Bitwise Operators -- The op= Use of Bitwise Operators -- Using Bitwise Operators -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Steps 3 and 4 -- Summary -- Chapter 4: Loops -- How Loops Work -- Introducing the Increment and Decrement Operators -- The for Loop -- General Form of the for Loop -- More on the Increment and Decrement Operators -- The Increment Operator -- The Prefix and Postfix Forms of the Increment Operator -- The Decrement Operator -- The for Loop Revisited -- Modifying the for Loop Control Variable -- A for Loop with No Parameters -- The break Statement in a Loop -- Limiting Input Using a for Loop -- Generating Pseudo-random Integers -- More for Loop Control Options -- Floating-Point Loop Control Variables -- Chars loop Control Variables -- The while Loop -- Nested Loops -- Nested Loops and the goto Statement -- The do-while Loop -- The continue Statement -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2
  • Step 3 -- Step 4 -- Step 5 -- Summary -- Chapter 5: Arrays -- An Introduction to Arrays -- Programming Without Arrays -- What Is an Array? -- Using an Array -- The Address of Operator -- Arrays and Addresses -- Initializing an Array -- Finding the Size of an Array -- Multidimensional Arrays -- Initializing Multidimensional Arrays -- Constant Arrays -- Variable-Length Arrays -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Step 4 -- Summary -- Chapter 6: Applications with Strings and Text -- What Is a String? -- Variables That Store Strings -- Arrays of Strings -- Operations with Strings -- Checking for C11/C17 Support -- Finding the Length of a String -- Copying Strings -- Concatenating Strings -- Comparing Strings -- Searching a String -- The Idea of a Pointer -- Searching a String for a Character -- Searching a String for a Substring -- Tokenizing a String -- Reading Newline Characters into a String -- Analyzing and Transforming Strings -- Converting Character Case -- Converting Strings to Numerical Values -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Summary -- Chapter 7: Pointers -- A First Look at Pointers -- Declaring Pointers -- Accessing a Value Through a Pointer -- Using Pointers -- Testing for a NULL Pointer -- Pointers to Constants -- Constant Pointers -- Naming Pointers -- Arrays and Pointers -- Multidimensional Arrays -- Multidimensional Arrays and Pointers -- Accessing Array Elements -- Using Memory As You Go -- Dynamic Memory Allocation: The malloc() Function -- Releasing Dynamically Allocated Memory -- Memory Allocation with the calloc() Function -- Extending Dynamically Allocated Memory -- Handling Strings Using Pointers -- Using Arrays of Pointers -- Pointers and Array Notation -- Designing a Program -- The Problem
  • Intro -- Table of Contents -- About the Authors -- About the Technical Reviewer -- Acknowledgments -- Introduction -- Chapter 1: Programming in C -- The C Language -- The Standard Library -- Learning C -- Creating C Programs -- Editing -- Compiling -- Linking -- Executing -- Creating Your First Program -- Editing Your First Program -- Dealing with Errors -- Dissecting a Simple Program -- Comments -- Preprocessing Directives -- Defining the main() Function -- Keywords -- The Body of a Function -- Outputting Information -- Function Arguments -- Control Characters -- Trigraph Sequences -- The Preprocessor -- Developing Programs in C -- Understanding the Problem -- Detailed Design -- Implementation -- Testing -- Functions and Modular Programming -- Common Mistakes -- Points to Remember -- Summary -- Chapter 2: First Steps in Programming -- Memory in Your Computer -- What Is a Variable? -- Naming Variables -- Variables That Store Integers -- Using Variables -- Initializing Variables -- Basic Arithmetic Operations -- More on Division with Integers -- Unary Operators -- Unary Minus Operator -- Variables and Memory -- Signed Integer Types -- Unsigned Integer Types -- Specifying Integer Constants -- Hexadecimal Constants -- Octal Constants -- Default Integer Constant Types -- Working with Floating-Point Numbers -- Floating-Point Number Representation -- Floating-Point Variables -- Division Using Floating-Point Values -- Controlling the Number of Decimal Places in the Output -- Controlling the Output Field Width -- More Complicated Expressions -- Defining Named Constants -- Knowing Your Limitations -- Introducing the sizeof Operator -- Choosing the Correct Type for the Job -- Explicit Type Conversion -- Automatic Conversions -- Rules for Implicit Conversions -- Implicit Conversions in Assignment Statements -- More Numeric Data Types -- Character Type
  • Single-Character Keyboard Input -- Output to the Screen -- Formatted Output Using printf_s() -- Escape Sequences -- Integer Output -- Outputting Floating-Point Values -- Character Output -- Other Output Functions -- Unformatted Output to the Screen -- Formatted Output to an Array -- Formatted Input from an Array -- Summary -- Chapter 11: Structuring Data -- Data Structures: Using struct -- Defining Structure Types and Structure Variables -- Accessing Structure Members -- Unnamed Structures -- Arrays of Structures -- Structure Members in Expressions -- Pointers to Structures -- Dynamic Memory Allocation for Structures -- More on Structure Members -- Structures As Members of a Structure -- Declaring a Structure Within a Structure -- Pointers to Structures As Structure Members -- Doubly Linked Lists -- Bit Fields in a Structure -- Structures and Functions -- Structures As Arguments to Functions -- Pointers to Structures As Function Arguments -- Structure As a Function Return Value -- Binary Trees -- Ordering Data in a Binary Tree -- Constructing a Binary Tree -- Traversing a Binary Tree -- Sharing Memory -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Step 4 -- Summary -- Chapter 12: Working with Files -- The Concept of a File -- Positions in a File -- File Streams -- Accessing Files -- Opening a File -- Write Mode -- Append Mode -- Read Mode -- Buffering File Operations -- Renaming a File -- Closing a File -- Deleting a File -- Writing a Text File -- Reading a Text File -- Reading and Writing Strings to a Text File -- Formatted File Input and Output -- Formatted Output to a File -- Formatted Input from a File -- Dealing with Errors -- More Open Modes for Text Files -- The freopen_s() Function -- Binary File Input and Output -- Opening a File in Binary Mode -- Writing a Binary File
  • Reading a Binary File
  • The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Step 4 -- Step 5 -- Step 6 -- Step 7 -- Step 8 -- The Complete Program -- Summary -- Chapter 8: Structuring Your Programs -- Program Structure -- Variable Scope and Lifetime -- Variable Scope and Functions -- Functions -- Defining a Function -- Naming a Function -- Function Parameters -- Specifying the Return Value Type -- The return Statement -- The Pass-by-Value Mechanism -- Function Prototypes -- Pointers As Parameters and Return Types -- const Parameters -- Perils of Returning Pointers -- Summary -- Chapter 9: More on Functions -- Pointers to Functions -- Declaring a Pointer to a Function -- Calling a Function Through a Function Pointer -- Arrays of Pointers to Functions -- Pointers to Functions As Arguments -- Variables in Functions -- Static Variables: Keeping Track Within a Function -- Sharing Variables Between Functions -- Functions That Call Themselves: Recursion -- Functions with a Variable Number of Arguments -- Copying a va_list -- Basic Rules for Variable-Length Argument Lists -- The main() Function -- Terminating a Program -- The abort() Function -- The exit() and atexit() Functions -- The _Exit() Function -- The quick_exit() and at_quick_exit() Functions -- Enhancing Performance -- Declaring Functions Inline -- Using the restrict Keyword -- The _Noreturn Function Specifier -- Designing a Program -- The Problem -- The Analysis -- The Solution -- Step 1 -- Step 2 -- Step 3 -- Step 4 -- Summary -- Chapter 10: Essential Input and Output -- Input and Output Streams -- Standard Streams -- Input from the Keyboard -- Formatted Keyboard Input -- Input Format Control Strings -- Characters in the Input Format String -- Variations on Floating-Point Input -- Reading Hexadecimal and Octal Values -- Reading Characters Using scanf_s() -- String Input from the Keyboard