C Tutorial

© Copyright 2023 by Peter Chapin
Last Revised: January 2023

Introduction

The documents linked to this page constitute the "lectures" of a one-semester, introductory course in the C programming language. I created these documents myself and have used them in programming classes at Vermont Technical College, where I am an instructor. I am posting these documents on the web for public access under the terms of the GNU Free Documentation License (GFDL).

Permission is granted to copy, distribute and/or modify this document (and the related subordinate documents as described above) under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no invariant sections, no front-cover texts, and no back-cover texts.


Lessons

This course covers all the major features of the C language: variables, types, expressions, control flow, functions, arrays, pointers, strings, and structures. In addition, I cover a number of other, minor topics. I have broken all of this material into 30 lessons along with some supporting files. Each lesson builds on the previous lessons. I recommend that you read the lessons in order. However, if you have some previous C experience, you may find it useful to skip around. The first three lessons are designed to get you on board using a Unix system where I assume you will be writing your programs. If you plan to work on a different operating system or if you are familiar with Unix, you may be able to skip those lessons. The C related content starts with Lesson #4.

When I last taught this course, the text associated with it was Stephen G. Kochan's "Programming in ANSI C" (Revised edition, Sams Publishing, (C) 1994, ISBN=0-672-30339-6). You could use any reasonable book on C to supplement this material. However, I have prepared specific reading assignments from Kochan's text to support each of the lessons.

In addition to the lessons themselves, I have also prepared some sample programs to help illustrate some points and to show the features of C in a larger context than is possible in the lessons. In the list below, I show links to these samples as well as to the lesson text. Each sample is associated with a particular lesson. You should review each sample after you've read the corresponding lesson text.

Other C features that I may write about at a later time include: enums, unions, bit fields, internationalization (i18n), and changes introduced in C99 (relative to C89/90). In addition, I would like to create a few more examples or perhaps elaborate a bit on some of the existing examples.


Links

The links below are of general interest.


© Copyright 2023 by Peter Chapin.
Last Revised: August 4, 2023