SoFunction
Updated on 2025-04-06

History and evolution of C language—C89, C99, C11, C17, C2x

As an ancient and popular programming language, C language has undergone the evolution and standardization of multiple versions. This article will deeply analyze the four sets of C language standards, namely C89, C99, C11 and C17, and illustrate the new features and improvements introduced by each standard through specific examples.

Traditional C

The C language at this time has not been standardized yet. The C description from "C Programming Language, First Edition, by Brian W. Kernighan, Dennis M. Ritchie. Prentice Hall PTR 1978" can be regarded as a "formal" standard, so the C at this time is also called "K&R" C.

During this period, the C language continued to undergo subtle changes, and each compiler manufacturer also had its own expansion, and this process continued until the late 1980s.

C89(C90)

C89 (also known as C90) was the earliest version of the standard in C language and was released in 1989. It defines the basic syntax, keywords and data types of C language, and introduces standard library functions such as and etc. The characteristics of C89 are simple, portable and easy to understand, and are widely used in various computer platforms.

Major changes to C89:

  • Defines the C standard library;
  • New preprocessing commands and features;
  • Function prototype (prototype);
  • New keywords: const, volatile, signed;
  • wide characters, wide strings, and multibyte characters;
  • Changes in conversion rules, declarations, type checks.

For example, the following code shows an example program written using the C89 standard:

#include <>

int main() {
    printf("Hello, C89!\n");

    return 0;
}

In this example, we use the C89 standard header file <> and function printf to output a piece of information.

C95

This is a revision and extension to C89, called "C89 with Amendment 1" or C95, which is not strictly a true standard.

Major changes to C95:

  • 3 new standard header files:,,;
  • some new tokens and macros;
  • some new printf/scanf series functions formatters;
  • A large number of wide and multi-byte character functions, constants, and types are added.

C99

The C99 standard was released in 1999 and has expanded and improved the C language. It introduces some new features such as variable-length arrays, composite literals, single-line comments, etc. C99 also provides more flexible variable declaration and initialization methods, allowing variables to be initialized while declaring them in code.

Major changes to C99:

  • complex;
  • integer type extension;
  • variable length array;
  • Boolean type;
  • Better support for non-English character sets;
  • Better support for floating point types;
  • Provide all types of mathematical functions;
  • C++ style comments (//)。

For example, the following code shows an example of variable-length arrays and composite literals introduced using the C99 standard:

#include &lt;&gt;

int main() {
    int n = 5;
    int arr[n]; // Variable length array
    for (int i = 0; i &lt; n; i++) {
        arr[i] = i + 1;
    }

    printf("Array: { ");
    for (int i = 0; i &lt; n; i++) {
        printf("%d ", arr[i]);
    }
    printf("}\n");

    return 0;
}

In this example, we use variable-length arrays introduced by the C99 standard to define the array arr, whose size is determined by the variable n. At the same time, we use compound literals to initialize elements of an array in a line of code.

C11

The C11 standard was released in 2011 and is another improvement and extension to the C language. It introduces some new features, such as anonymous structures, generic selection expressions, multi-threading support, etc. C11 also made subtle improvements and corrections to some existing features, improving the expressiveness and reliability of language.

For example, the following code shows an example of anonymous structures and generic selection expressions introduced using the C11 standard:

#include &lt;&gt;

int main() {
    struct {
        int x;
        int y;
    } point = { .x = 5, .y = 10 }; // Anonymous structure
    _Generic(point, 
             struct { int x; int y; }: printf("Point: (%d, %d)\n", , ),
             default: printf("Invalid data type!\n")); // Generic selection expression
    return 0;
}

In this example, we used anonymous structs introduced by the C11 standard to define the structure variable point, and used the generic selection expression _Generic to select different operations based on the type of the variable.

C17

C17 (also known as C18) is the informal name of ISO/IEC 9899:2018 released in June 2018 and is also the latest C programming standard currently (as of June 2020) and is used to replace the C11 standard.

C17 did not introduce new language features, only C11 has been supplemented and revised.

C2x

The next version of the C standard is expected to be completed on December 1, 2022.

Many people have proposed to add object-oriented features to C, including adding classes, inheritance, polymorphism, etc. syntax features that have been widely used by C++ languages, but were eventually rejected by the committee. Because these complex grammatical features do not conform to the design philosophy and design philosophy of C, and C++ already has these features, C language does not need to support them anymore.

Summarize

The four sets of standards in C (C89, C99, C11 and C17) represent the evolution and improvement process of C. Each standard introduces new features and improvements, providing programmers with more powerful and flexible programming tools. Through the description of specific examples, we have explored the characteristics and new features of each standard, helping you understand the different versions of C language, and providing guidance for you to choose the right standard in actual programming.

This is the end of this article about the history and evolution of C language - C89, C99, C11, C17, C2x. For more related contents of C89, C99, C11, C17, C2x, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!