TIENE EN SU CESTA DE LA COMPRA
en total 0,00 €
You Will Learn C!
Zed Shaw has crafted the perfect course for the beginning C programmer eager to advance their skills in any language. Follow it and you will learn the many skills early and junior programmers need to succeed-just like the hundreds of thousands of programmers Zed has taught to date! You bring discipline, commitment, persistence, and experience with any programming language; the author supplies everything else.
In Learn C the Hard Way, you'll learn C by working through 52 brilliantly crafted exercises. Watch Zed Shaw's teaching video and read the exercise. Type his code precisely. (No copying and pasting!) Fix your mistakes. Watch the programs run. As you do, you'll learn what good, modern C programs look like; how to think more effectively about code; and how to find and fix mistakes far more efficiently. Most importantly, you'll master rigorous defensive programming techniques, so you can use any language to create software that protects itself from malicious activity and defects.
Through practical projects you'll apply what you learn to build confidence in your new skills. Shaw teaches the key skills you need to start writing excellent C software, including
Setting up a C environment
Basic syntax and idioms
Compilation, make files, and linkers
Operators, variables, and data types
Program control
Arrays and strings
Functions, pointers, and structs
Memory allocation
I/O and files
Libraries
Data structures, including linked lists, sort, and search
Stacks and queues
Debugging, defensive coding, and automated testing
Fixing stack overflows, illegal memory access, and more
Breaking and hacking your own C code
It'll Be Hard at First. But Soon, You'll Just Get It-And That Will Feel Great!
This tutorial will reward you for every minute you put into it. Soon, you'll know one of the world's most powerful programming languages. You'll be a C programmer.
Watch Zed, too! The accompanying DVD contains 5+ hours of passionate, powerful teaching: a complete C video course! If you purchase the digital edition, be sure to read ´Where Are the Companion Content Files´ at the end of the eBook to learn how to access the videos.
Acknowledgments xiv
This Book Is Not Really about C xv
The Undefined Behaviorists xvi
C Is a Pretty and Ugly Language xvii
What You Will Learn xviii
How to Read This Book xviii
The Videos xix
Exercise 0: The Setup 2
Linux 2
Mac OS X 2
Windows 3
Text Editor 3
Exercise 1: Dust Off That Compiler 6
Breaking It Down 6
What You Should See 7
How to Break It 8
Extra Credit 8
Exercise 2: Using Makefiles to Build 10
Using Make 10
What You Should See 11
How to Break It 12
Extra Credit 12
Exercise 3: Formatted Printing 14
What You Should See 15
External Research 15
How to Break It 15
Extra Credit 16
Exercise 4: Using a Debugger 18
GDB Tricks 18
GDB Quick Reference 18
LLDB Quick Reference 19
Exercise 5: Memorizing C Operators 20
How to Memorize 20
The List of Operators 21
Exercise 6: Memorizing C Syntax 26
The Keywords 26
Syntax Structures 27
A Word of Encouragement 30
A Word of Warning 31
Exercise 7: Variables and Types 32
What You Should See 34
How to Break It 34
Extra Credit 34
Exercise 8: If, Else-If, Else 36
What You Should See 37
How to Break It 37
Extra Credit 38
Exercise 9: While-Loop and Boolean Expressions 40
What You Should See 40
How to Break It 41
Extra Credit 41
Exercise 10: Switch Statements 42
What You Should See 43
How to Break It 44
Extra Credit 44
Exercise 11: Arrays and Strings 46
What You Should See 47
How to Break It 48
Extra Credit 48
Exercise 12: Sizes and Arrays 50
What You Should See 51
How to Break It 52
Extra Credit 53
Exercise 13: For-Loops and Arrays of Strings 54
What You Should See 56
Understanding Arrays of Strings 56
How to Break It 57
Extra Credit 57
Exercise 14: Writing and Using Functions 58
What You Should See 59
How to Break It 60
Extra Credit 60
Exercise 15: Pointers, Dreaded Pointers 62
What You Should See 64
Explaining Pointers 65
Practical Pointer Usage 66
The Pointer Lexicon 66
Pointers Aren't Arrays 67
How to Break It 67
Extra Credit 67
Exercise 16: Structs and Pointers to Them 68
What You Should See 71
Explaining Structures 71
How to Break It 72
Extra Credit 72
Exercise 17: Heap and Stack Memory Allocation 74
What You Should See 79
Heap versus Stack Allocation 80
How to Break It 81
Extra Credit 82
Exercise 18: Pointers to Functions 84
What You Should See 88
How to Break It 88
Extra Credit 89
Exercise 19: Zed's Awesome Debug Macros 90
The C Error-Handling Problem 90
The Debug Macros 91
Using dbg.h 93
What You Should See 95
How the CPP Expands Macros 96
Extra Credit 98
Exercise 20: Advanced Debugging Techniques 100
Debug Printing versus GDB 100
A Debugging Strategy 101
Extra Credit 102
Exercise 21: Advanced Data Types and Flow Control 104
Available Data Types 104
Available Operators 108
Available Control Structures 110
Extra Credit 111
Exercise 22: The Stack, Scope, and Globals 112
ex22.h and ex22.c 112
ex22_main.c 114
What You Should See 117
Scope, Stack, and Bugs 118
How to Break It 119
Extra Credit 119
Exercise 23: Meet Duff's Device 120
What You Should See 124
Solving the Puzzle 124
Extra Credit 125
Exercise 24: Input, Output, Files 126
What You Should See 128
How to Break It 129
The I/O Functions 129
Extra Credit 130
Exercise 25: Variable Argument Functions 132
What You Should See 135
How to Break It 136
Extra Credit 136
Exercise 26: Project logfind 138
The logfind Specification 138
Exercise 27: Creative and Defensive Programming 140
The Creative Programmer Mind-Set 140
The Defensive Programmer Mind-Set 141
The Eight Defensive Programmer Strategies 141
Applying the Eight Strategies 142
Order Is Not Important 149
Extra Credit 150
Exercise 28: Intermediate Makefiles 152
The Basic Project Structure 152
Makefile 153
What You Should See 159
Extra Credit 159
Exercise 29: Libraries and Linking 160
Dynamically Loading a Shared Library 161
What You Should See 163
How to Break It 164
Extra Credit 164
Exercise 30: Automated Testing 166
Wiring Up the Test Framework 167
Extra Credit 171
Exercise 31: Common Undefined Behavior 172
UB 20 173
Exercise 32: Double Linked Lists 174
What Are Data Structures 178
Making the Library 178
Doubly Linked Lists 179
Tests 185
What You Should See 187
How to Improve It 188
Extra Credit 188
Exercise 33: Linked List Algorithms 190
Bubble and Merge Sort 190
The Unit Test 191
The Implementation 193
What You Should See 195
How to Improve It 196
Extra Credit 1