Main Page | See live article | Alphabetical index

ANSI C

ANSI C (Standard C) is a variant of the C programming language. POSIX and the Single UNIX Specification are others.

Most programming languages have differences from one implementation to another. For example, a C compiler on a Microsoft Windows system may have some features not found in its counterpart on a UNIX system, or that are accessed in a different way. While this is acceptable in some cases, in others, it may be important to be able to compile the same source code on different systems so as to be able to have the program on different systems at minimal cost.

The community solves this problem by defining a subset of a programming language and standardizing it so different manufacturers abide by it; this means that as long as the programmer sticks with the subset, the software can be ported from one platform to another. In this case, the American National Standards Institute created a standard for C, and it is referred to as ANSI C. When compilers and programmers stick to one standard such as ANSI C, then portablity follows relatively easily.

Frequently, it's unreasonable to try to write any non-trivial program in such a way that it can be ported from one platform to another without changes; in this case, one tries to restrict the non-portable code to minimize the effort of porting.

See Also