Programming in C

Chapter 1, 6/27/93

I will be teaching the C language by way of examples and explanation. I encourage folks to comment on (and correct) my work. Important corrections and selected comments will make their way into the archived versions of the tutorial.
When the essential features of the language have been covered, I'll begin to branch out by presenting chapters on various programming techniques as expressed in C. The C++ language is a potential future topic, but naturally I can't cover every possible subject at once.
I'll post chapters as often as is practical given my available time. (Keep in mind that I'm being paid the fabulous sum of zero dollars and zero cents for my services before complaining about the amount of time between chapters, folks!)
I will be teaching ANSI standard C, with notes on how to make the programs work on a non-ANSI compiler.
In order to keep up with the tutorial without reading all of comp.lang.c, just search for messages with "TUTORIAL" (capitalized) in the "Subject" line. (In rn, this is done using the / key.) If the volume of discussion becomes truly spectacular, I'll seek the creation of new newsgroups, but after considering the possibilities (such as an alt.uu Usenet University group) I've determined that the best thing for now is to start out in the mainstream of comp.lang.c and migrate when and if there's a demand to do so.
To follow along with the tutorial, you will need the following:
1. A reasonable working knowledge of the system you're using. It is NOT the goal of this tutorial to teach Unix or VMS or MSDOS or MacOS or what have you! I will give a quick explanation of the commands to be used to compile programs under Unix; for personal computers, the commands are usually self-evident, as most C programming software for PCs provides a mouse-driven interface.
2. A C compiler.
3. RECOMMENDED: a copy of Kernighan and Ritchie's "The C Programming Language," second edition. This is not a tutorial, but rather an excellent reference guide to the C language as well as an opportunity to learn more about the language from its creators, Brian Kernighan and Dennis Ritchie.
4. An editor: for MSDOS (IBM compatible) and Macintosh systems this is no problem as an editing environment usually comes with the compiler. For Unix/VMS/what have you, you'll need to be familiar with vi, emacs or another text editor in which to compose your programs. Unix users who post to USENET news are already familiar with vi in most cases, since it's the editor in which messages are composed. To edit a file in vi (for those who have only seen it when posting to news or editing mail) use the command "vi filename" (where filename is the name of the file you will be editing) at the "%" prompt of Unix.
... AND NOW WE BEGIN
Once you have the items listed above, proceed to the next chapter of the tutorial, in which I will present the first program.

Next >>