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.
- Title
- Learn C the Hard Way
- Subtitle
- Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)
- Publisher
- Addison-Wesley Professional
- Author(s)
- Zed A. Shaw
- Published
- 2015-08-10
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 842
- Language
- English
- ISBN-10
- 9353065720
- ISBN-13
- 9789353065720
- License
- Read online for free
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
About This eBook Title Page Copyright Page Contents Acknowledgments This Book Is Not Really about C The Undefined Behaviorists C Is a Pretty and Ugly Language What You Will Learn How to Read This Book The Videos The Core Competencies Reading and Writing Attention to Detail Spotting Differences Planning and Debugging Exercise 0. The Setup Linux Mac OS X Windows Text Editor Do Not Use an IDE Exercise 1. Dust Off That Compiler Breaking It Down What You Should See How to Break It Extra Credit Exercise 2. Using Makefiles to Build Using Make What You Should See How to Break It Extra Credit Exercise 3. Formatted Printing What You Should See External Research How to Break It Extra Credit Exercise 4. Using a Debugger GDB Tricks GDB Quick Reference LLDB Quick Reference Exercise 5. Memorizing C Operators How to Memorize The List of Operators Exercise 6. Memorizing C Syntax The Keywords Syntax Structures A Word of Encouragement A Word of Warning Exercise 7. Variables and Types What You Should See How to Break It Extra Credit Exercise 8. If, Else-If, Else What You Should See How to Break It Extra Credit Exercise 9. While-Loop and Boolean Expressions What You Should See How to Break It Extra Credit Exercise 10. Switch Statements What You Should See How to Break It Extra Credit Exercise 11. Arrays and Strings What You Should See How to Break It Extra Credit Exercise 12. Sizes and Arrays What You Should See How to Break It Extra Credit Exercise 13. For-Loops and Arrays of Strings What You Should See Understanding Arrays of Strings How to Break It Extra Credit Exercise 14. Writing and Using Functions What You Should See How to Break It Extra Credit Exercise 15. Pointers, Dreaded Pointers What You Should See Explaining Pointers Practical Pointer Usage The Pointer Lexicon Pointers Aren’t Arrays How to Break It Extra Credit Exercise 16. Structs And Pointers to Them What You Should See Explaining Structures How to Break It Extra Credit Exercise 17. Heap and Stack Memory Allocation What You Should See Heap versus Stack Allocation How to Break It Extra Credit Exercise 18. Pointers to Functions What You Should See How to Break It Extra Credit Exercise 19. Zed’s Awesome Debug Macros The C Error-Handling Problem The Debug Macros Using dbg.h What You Should See How the CPP Expands Macros Extra Credit Exercise 20. Advanced Debugging Techniques Debug Printing versus GDB A Debugging Strategy Extra Credit Exercise 21. Advanced Data Types and Flow Control Available Data Types Type Modifiers Type Qualifiers Type Conversion Type Sizes Available Operators Math Operators Data Operators Logic Operators Bit Operators Boolean Operators Assignment Operators Available Control Structures Extra Credit Exercise 22. The Stack, Scope, and Globals ex22.h and ex22.c ex22_main.c What You Should See Scope, Stack, and Bugs How to Break It Extra Credit Exercise 23. Meet Duff’s Device What You Should See Solving the Puzzle Why Bother? Extra Credit Exercise 24. Input, Output, Files What You Should See How to Break It The I/O Functions Extra Credit Exercise 25. Variable Argument Functions What You Should See How to Break It Extra Credit Exercise 26. Project logfind The logfind Specification Exercise 27. Creative and Defensive Programming The Creative Programmer Mind-Set The Defensive Programmer Mind-Set The Eight Defensive Programmer Strategies Applying the Eight Strategies Never Trust Input Prevent Errors Fail Early and Openly Document Assumptions Prevention over Documentation Automate Everything Simplify and Clarify Question Authority Order Is Not Important Extra Credit Exercise 28. Intermediate Makefiles The Basic Project Structure Makefile The Header The Target Build The Unit Tests The Cleaner The Install The Checker What You Should See Extra Credit Exercise 29. Libraries and Linking Dynamically Loading a Shared Library What You Should See How to Break It Extra Credit Exercise 30. Automated Testing Wiring Up the Test Framework Extra Credit Exercise 31. Common Undefined Behavior UB 20 Common UBs Exercise 32. Double Linked Lists What Are Data Structures Making the Library Doubly Linked Lists Definition Implementation Tests What You Should See How to Improve It Extra Credit Exercise 33. Linked List Algorithms Bubble and Merge Sorts The Unit Test The Implementation What You Should See How to Improve It Extra Credit Exercise 34. Dynamic Array Advantages and Disadvantages How to Improve It Extra Credit Exercise 35. Sorting and Searching Radix Sort and Binary Search C Unions The Implementation RadixMap_find and Binary Search RadixMap_sort and radix_sort How to Improve It Extra Credit Exercise 36. Safer Strings Why C Strings Were a Horrible Idea Using bstrlib Learning the Library Exercise 37. Hashmaps The Unit Test How to Improve It Extra Credit Exercise 38. Hashmap Algorithms What You Should See How to Break It Extra Credit Exercise 39. String Algorithms What You Should See Analyzing the Results Extra Credit Exercise 40. Binary Search Trees How to Improve It Extra Credit Exercise 41. Project devpkg What Is devpkg? What We Want to Make The Design The Apache Portable Runtime Project Layout Other Dependencies The Makefile The Source Files The DB Functions The Shell Functions The Command Functions The devpkg Main Function The Final Challenge Exercise 42. Stacks and Queues What You Should See How to Improve It Extra Credit Exercise 43. A Simple Statistics Engine Rolling Standard Deviation and Mean Implementation How to Use It Extra Credit Exercise 44. Ring Buffer The Unit Test What You Should See How to Improve It Extra Credit Exercise 45. A Simple TCP/IP Client Augment the Makefile The netclient Code What You Should See How to Break It Extra Credit Exercise 46. Ternary Search Tree Advantages and Disadvantages How to Improve It Extra Credit Exercise 47. A Fast URL Router What You Should See How to Improve It Extra Credit Exercise 48. A Simple Network Server The Specification Exercise 49. A Statistics Server Specification Exercise 50. Routing the Statistics Exercise 51. Storing the Statistics The Specification Exercise 52. Hacking and Improving Your Server Next Steps Index Where are the Companion Content Files? Code Snippets