This document aims to:-
- Introduce C by providing and explaining examples of common programming tasks.
- Enable the reader to learn from available source code by clarifying common causes of incomprehension.
This document aims to:-
The notes on these pages are for the courses in C Programming I used to teach in the Experimental College at the University of Washington in Seattle, WA. Normally these notes accompany fairly traditional classroom lecture presentations, but they are intended to be reasonably complete (more so, for that matter, than the lectures!) and should be usable as standalone tutorials.
If you want to be proficient in the writing of code in the C programming language, you must have a thorough working knowledge of how to use pointers. Unfortunately, C pointers appear to represent a stumbling block to newcomers, particularly those coming from other computer languages such as Fortran, Pascal or Basic.
Kernighan and Plauger’s The Elements of Programming Style was an important and rightly influential book. But sometimes I feel its concise rules were taken as a cookbook approach to good style instead of the succinct expression of a philosophy they were meant to be. If the book claims that variable names should be chosen meaningfully, doesn’t it then follow that variables whose names are small essays on their use are even better? Isn’t MaximumValueUntilOverflow a better name than maxval? I don’t think so.
Kernighan and Plauger’s The Elements of Programming Style was an important and rightly influential book. But sometimes I feel its concise rules were taken as a cookbook approach to good style instead of the succinct expression of a philosophy they were meant to be. If the book claims that variable names should be chosen meaningfully, doesn’t it then follow that variables whose names are small essays on their use are even better? Isn’t MaximumValueUntilOverflow a better name than maxval? I don’t think so.
C is a computer language available on the GCOS and UNIX operating systems at Murray Hill and (in preliminary form) on OS/360 at Holmdel. C lets you write your programs clearly and simply it has decent control flow facilities so your code can be read straight down the page, without labels or GOTO’s; it lets you write code that is compact without being too cryptic; it encourages modularity and good program organization; and it provides good data-structuring facilities.
This is still wise counsel, although many modern compilers search out many of the same sins, and there are often problems with lint being aged and infirm, or unavailable in strange lands. There are other tools, such as Saber C, useful to similar ends.
This Rationale summarizes the deliberations of X3J11, the Technical Committee charged by ANSI with devising a standard for the C programming language. It has been published along with the draft Standard to assist the process of formal public review.
This page lists various static code analysis tools that compute metrics defined on C and C++ source code. The metrics are primarily size and complexity of various types (lines of code, Halstead, McCabe, etc.).
The C programming language was devised in the early 1970s as a system implementation language for the nascent Unix operating system. Derived from the typeless language BCPL, it evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment, it has become one of the dominant languages of today. This paper studies its evolution.