Newbies What Next ? News Forums Calendar


News Sections
General News (3987/0)
Reviews (637/0)
Press Releases (465/0)
Distributions (197/0)
Software (911/0)
Hardware (537/0)
Security (192/0)
Tutorials (356/0)
Off Topic (181/0)

User Functions


Don't have an account yet? Sign up as a New User

There are no upcoming events

9 of the Best Free C Books - Part 1

9 of the Best Free C Books

C is a general-purpose, procedural, portable, programming language that is one of the most widely used languages. It was designed to be compiled using a straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support. Many programming languages owe a considerable debt to C. It has become something of the lingua franca in the programming world.

C is fairly simple to understand. It is a very flexible, practical and compact language combined with an easy to read syntax. Code written in C runs quickly, with easy access to the low level facilities in the computer. Compiler directives make it possible to produce a single version of a program compiled for different architectures.

The C Programming Language by Brian Kernighan and Dennis Ritchie is the complete guide to the ANSI standard C language programming. The authors are the developers of C, and show readers show to take advantage of all of the rich tapestry of C. The book is a classic. However, there is a good range of books that teach C and are available to download without charge. To cater for all tastes, we have selected a diverse selection of informative books for C.

None of the books featured here could possibly replace Kernighan and Ritchie's masterpiece. However, all of the texts here come with our strongest recommendation. So get reading (and downloading).

1. The C Book

The C Book
Author Mike Banahan, Declan Brady and Mark Doran
Format PDF, HTML
Pages 350

The C Book is designed for programmers who already have some experience of using a modern high-level procedural programming language. The book concentrates on the things that are special to C. In particular, it is the way that C is used which is focused on.

Chapters include:

  • An Introduction to C
  • Variables and Arithmetic - introduces some of the fundamentals of C, including keywords and identifiers, declaration of variables, real types, integral types, expressions and arithmetic, and constants
  • Control of Flow and Logical Expressions - looks at the various ways that the control of flow statements can be used in a C program, including some statements that have not been introduced so far. Control of flow, more logical expressions, and strange operators
  • Functions - the type of functions, recursion and argument passing, and linkage
  • Arrays and Pointers - arrays, pointers, character handling, sizeof and storage allocation, pointers to functions, expressions involving pointers, arrays, the & operator and function declarations
  • Structured Data Types - structures, unions, bitfields, enums, qualifiers and derived types, and initialization
  • The Preprocessor - how the preprocessor works, and directives
  • Specialized Areas of C - declarations, definitions and accessibility, typedef, const and volatile, and sequence points
  • Libraries - diagnostics, character handling, localization, limits, mathematical functions, non-local jumps, signal handling, variable numbers of arguments, input and output, formatted I/O, character I/O, unformatted I/O, random access functions, general utilities, string handling, and date and time
  • Complete Programs in C - putting it all together, arguments to main, interpreting program arguments, a pattern matching program, and a more ambitious example

2. Learn C The Hard Way

Learn C The Hard Way
Author Zed Shaw
Format HTML
Pages 380

Learn C The Hard Way fills in the "beginning programmer" gap in the literature on the C Programming language. It teaches good modern C programming practices and avoid habits that lead to buffer overflows, security defects, and other problems that even experienced programmers run into.;

This book is designed for:

  • Students who have read Learn Python The Hard Way or Learn Ruby The Hard Way
  • Programmers with skill in one other "scripting" language
  • Programmers who need to relearn C
  • Objective-C programmers who want better C skills
  • People who like a challenge

The purpose of this book is to teach you how your computer really works, and included in that is how various data structures and algorithms function.

Chapters cover:

  • Make is your Python now - a crash course in make, and you will be learning to use it as you learn C
  • Formatted Printing
  • Introducing Valgrind - an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail
  • The Structure of a C Program - break down a simple C program line-by-line so you know how one is structured
  • Types of Variables - integers, floating point, character, and string
  • More Variables, Some Math - more things you can do with variables by declaring various ints, floats, chars, and doubles. Then use these variables in various math expressions so you get introduced to C's basic math
  • Sizes and Arrays - introduces a few more concepts: sizeof and arrays
  • Arrays of Strings, Looping - shows you that C stores its strings simply as an array of bytes, terminated with the '\0' (nul) byte
  • While-Loop and Boolean Expressions - see how a while-loop works
  • If, Else-If, Else - something common in every language is the if-statement, and C has one
  • Switch Statement - some code that we will break down to understand this concept of "jump tables"
  • Writing and Using Functions - write some functions and use some other functions
  • Pointers Dreaded Pointers - demystifies pointers
  • Structs and Pointers to them - learn how to make a struct, point a pointer at them, and use them to make sense of internal memory structures
  • Heap and Stack Memory Allocation - create an entire small program to manage a database
  • Pointers to Functions - functions in C are actually just pointers to a spot in the program where some code exists
  • A Simple Object System - this exercise will build a simple game where you kill a Minotaur in a small little castle
  • Zed's Awesome Debug Macros - a small set of "debug macros" that implement a basic debugging and error handling system for C
  • Advanced Data Types and Flow Control - this exercise will be a complete compendium of the available C data types and flow control structures you can use
  • The Stack, Scope, and Globals - learn about scope by learning about how a stack data structure works, and then feeding that concept back in to how modern C does scoping
  • Meet Duff's Device - this exercise is a brain teaser introducing a famous hack in C
  • Input, Output, Files - use the functions fscanf and fgets to build information about a person in a structure. After this simple introduction to reading input, you will get a full list of the functions that C has for I/O
  • Variable Argument Functions - knowing how a variable argument function works helps debug them and provides a greater understanding of the computer
  • Write a First Real Program - recreate a piece of software, devpkg - a simple C program that installs other software
  • Creative and Defensive Programming - advanced concepts and feature more talking than code
  • Intermediate Makefiles - create a skeleton project directory to use in building your C programs later
  • Libraries and Linking - learning how C links things helps you understand how your OS works and how it runs your programs
  • Automated Testing - used frequently in other languages like Python and Ruby, but rarely used in C
  • Debugging Code - Debug Printing vs GDB vs Valgrind
  • Double Linked Lists
  • Linked List Algorithms - covers two algorithms you can do on a linked list that involve sorting
  • Dynamic Array - an array that grows on its own and has most of the same features as a linked list
  • Sorting and Searching - covers four sorting algorithms and one search algorithm
  • Safer Strings - designed to get you into using bstring from now on, why C's strings are an incredibly bad idea, and then have you change the liblcthw code to use bstring
  • Hashmaps - Hash Maps (Hashmaps, Hashes, or sometimes Dictionaries) are used frequently in many dynamic programming for storing key/value data
  • Hashmap Algorithms - implement three hash functions: FNV-1a, Adler-32, and DJB Hash
  • String Algorithms - gist of this algorithm is that it calculates a "skip characters list" as a first operation, then it uses this list to quickly scan through the string
  • Binary Search Trees - the simplest tree based data structure
  • Using Cachegrind and Callgrind for Performance Tuning - a quick course in using two tools for Valgrind called callgrind and cachegrind
  • Stacks and Queues - very simple data structures that are really variants of the List data structure
  • A Simple Statistics Engine - a simple algorithm used for collecting summary statistics "online"
  • Ring Buffer - useful when processing asynchronous IO. They allow one side to receive data in random intervals of random sizes, but feed cohesive chunks to another side in set sizes or intervals
  • A Simple TCP/IP Client - use the RingBuffer to create a very simplistic little network testing tool called netclient
  • Ternary Search Tree
  • A Fast URL Router - use the TSTree to do fast URL routing in web servers
  • A Tiny Virtual Machine - implements a version of the DCPU16 virtual machine using the algorthms created previously

3. Introduction to C Programming

Introduction to C Programming
Author Rob Miles
Format HTML, PDF
Pages 97

Introduction to C Programming is, as its name suggests, a book for anyone completely new to programming and wants to learn C.

Chapters include:

  • Computers
  • Programming Languages - examines what is programming, and a brief examination of programming languages
  • C - looks at the advantages and disadvantages of C
  • A First C Program - making C run, creating C programs, what comprises a C program, the advantages and disadvantages of C
  • Variables - looks at types of variables, declaration (int, float, char variables, missing types), variable declaration, giving values to variables, and getting values into the program
  • Writing a Program
  • Functions - identified by name and can return a single value. They act on parameters, which are used to pass information into them. In our case we want a function which is given the maximum and minimum values which something can have, and returns a value in that range
  • Arrays - explains why arrays are needed, array types and sizes
  • Switching - making multiple decisions
  • Strings - computer jargon for lumps of text
  • Structures - explains what is a structure, how they work, pointers to structures, and defining your own types
  • Files - when are files used, fopen and fclose, and file functions
  • Memory - fetching memory (malloc and free), and the heap
  • C and Large Programs - building large programs in C, and the C pre-processor

Next Section: 9 of the Best Free C Books - Part 2

This article is divided into three parts:

Part 1, Part 2, Part 3

Bookmark and Share

Last Updated Saturday, July 04 2015 @ 01:45 PM EDT

We have written a range of guides highlighting excellent free books for popular programming languages. Check out the following guides: C, C++, C#, Java, JavaScript, CoffeeScript, HTML, Python, Ruby, Perl, Haskell, PHP, Lisp, R, Prolog, Scala, Scheme, Forth, SQL, Node.js (new), Fortran (new), Erlang (new), Pascal (new), and Ada (new).

Group Tests
100 Essential Apps
All Group Tests

Top Free Software
5 Office Suites
3 Lean Desktops
7 Document Processors
4 Distraction Free Tools
9 Project Management
4 Business Solutions
9 Groupware Apps
14 File Managers
10 Databases
21 Backup Tools
21 Productivity Tools
5 Note Taking Apps
9 Terminal Emulators
21 Financial Tools
5 Bitcoin Clients
21 Text Editors
21 Video Emulators
21 Home Emulators
42 Graphics Apps
6 CAD Apps
42 Scientific Apps
10 Web Browsers
42 Email Apps
12 Instant Messaging
10 IRC Clients
7 Twitter Clients
12 News Aggregators
11 VoIP Apps
42 Best Games
9 Steam Games
42 Audio Apps
5 Music Streaming
42 Video Apps
5 YouTube Tools
80 Security Apps
9 System Monitoring
8 Geometry Apps
Free Console Apps
14 Multimedia
4 Audio Grabbers
9 Internet Apps
3 HTTP Clients
5 File Managers
8 Compilers
9 IDEs
9 Debuggers
7 Revision Control Apps
6 Doc Generators
Free Web Software
21 Web CMS
14 Wiki Engines
8 Blog Apps
6 eCommerce Apps
5 Human Resource Apps
10 ERP
10 CRM
6 Data Warehouse Apps
8 Business Intelligence
6 Point-of-Sale

Other Articles
Migrating from Windows
Back up your data
20 Free Linux Books
24 Beginner Books
12 Shell Scripting Books

Older Stories
Sunday 04/12
  • First Peek at XBian on the Raspberry Pi 2 (0)

  • Saturday 04/04
  • First Look at OSMC RC on the Raspberry Pi 2 (0)

  • Sunday 03/29
  • First Steps with OpenELEC on the Raspberry Pi 2 (0)
  • Ubuntu MATE 15.04 for Raspberry Pi 2 (0)

  • Monday 03/16
  • MIPS Creator CI20 v Raspberry Pi 2 (0)
  • Raspberry Pi 2: Raspbian (ARMv6) v Linaro (ARMv7) (0)

  • Friday 03/06
  • Raspberry Pi 2 review (0)

  • Sunday 02/22
  • Chess in a Few Bytes (0)
  • Learn the Art of Computer Programming With These Great Free Beginner Books (2)
  • CD Audio Grabbers (0)

  • Vote

    What Linux distribution do you run on your main computer?

    842 votes | 3 comments

    Built with GeekLog and phpBB
    Comments to the webmaster are welcome
    Copyright 2009 - All rights reserved