Safekipedia
American inventionsC (programming language)C (programming language) librariesC programming language family

C (programming language)

Adapted from Wikipedia · Adventurer experience

A logo or diagram representing the C programming language, used in many important software systems.

C is a general-purpose programming language created in the 1970s by Dennis Ritchie . It was made to give programmers control over a computer’s hardware while still being easy to use. This makes C special—it can do simple tasks, like controlling tiny sensors, and complex tasks, like powering entire operating systems.

Originally developed at Bell Labs between 1972 and 1973, C was used to rebuild the Unix operating system. It became very popular in the 1980s and is still widely used today. You can find C running everywhere—from giant supercomputers to tiny chips inside microcontrollers and embedded systems .

C works by letting programmers write instructions that closely match a computer’s inner workings. It can be compiled into fast machine code, so programs in C often run quickly. Even though it doesn’t include every modern feature, C is flexible. Extra tools—like object orientation or memory management—can be added when needed. Because of its power and flexibility, C has often been one of the top-ranked languages in the TIOBE index .

Characteristics

Dennis Ritchie (right), the inventor of the C programming language, with Ken Thompson

The C programming language has many useful features. It lets you write code in any way you like and uses semicolons to end each line. Code blocks are made with curly braces, and functions hold the code that runs.

C helps control programs with statements like if, for, do, while, and switch. It works with numbers, bits, and logic. The language has few special words and can repeat actions and use fixed types of data. C lets programs talk directly to the computer memory using pointers. It also has a tool for making shortcuts and including files, which makes it good for operating systems and embedded systems.

"Hello, world" example

The "Hello, World!" program is a simple way to start learning programming. It just shows the words "hello, world" on the screen.

The original version looks like this:

main()
{
    [printf](/wiki/Printf)("hello, world\\n");
}
"Hello, World" program by Brian Kernighan (1978)

A more modern version is:

#include 

int main(void)
{
    printf("hello, world\\n");
}

The first line prepares the computer to show text. The main part is where the program begins, and printf displays the message. The \n makes the screen move to a new line after showing the text.

History

The C programming language began with the Unix operating system. It was first made in the 1970s by Dennis Ritchie and Ken Thompson. They worked on a computer called the PDP-11. They needed a better way to write programs, so they created C. This made it easier to manage and improve Unix.

Over time, C became very popular. It was used for many kinds of programs. It was updated several times to add new features and work better on new computers. Today, C is still used for creating operating systems and other important software, even though it was made a long time ago.

Main article: B (programming language) Main article: ANSI C Main article: C99 Main article: C11 Main article: C17 Main article: C23 Main article: C2Y Main article: Embedded C

Timeline of C language
YearInformal
name
Official
standard
1972first release—N/a
1978K&R C—N/a
1989,
1990
ANSI C, C89,
ISO C, C90
ANSI X3.159-1989
ISO/IEC 9899:1990
1999C99, C9XISO/IEC 9899:1999
2011C11, C1XISO/IEC 9899:2011
2018C17, C18ISO/IEC 9899:2018
2024C23, C2XISO/IEC 9899:2024
TBAC2Y

Definition

C is a programming language with a clear structure. It uses special symbols to mark comments. Its code is organized into functions and declarations. These functions can contain statements that control how the program runs, like loops and condition checks.

The language includes reserved words that have special meanings. It also offers many operators to perform calculations and manipulate data. C handles data in specific types, such as numbers and characters. It allows direct memory access through pointers, which are powerful but need careful handling.

Language tools

Many tools help C programmers write better code by finding mistakes. One popular tool is Lint. It checks for unusual or risky code early. Programmers often run Lint first, then use the C compiler to build their programs.

Other tools help with tasks like checking array limits, tracking memory use, and managing data safely. Tools such as Purify and Valgrind find problems while a program runs.

Uses

Some software written in C

C is used to make many different kinds of programs, from everyday apps to tools that help run computers. It works well for building operating systems and programs that need to talk directly to the computer's hardware.

C is chosen for system programming because it lets programmers control how the computer works. It is fast and uses memory efficiently, which makes it great for tasks that need to be quick. Many important programs, like web servers and parts of video games, are written in C. C is also used to create tools and libraries that help other programming languages work, showing just how useful and popular it is.

Limitations

C is a strong but tricky programming language made by Dennis Ritchie. It lets programmers control a computer's hardware very closely. But this can sometimes lead to mistakes. For example, working with memory can be hard and might cause problems if not done right. The language also lets programmers access memory directly, which can sometimes lead to errors if not handled well.

Some parts of C are not very strict, so programmers must be very careful to avoid mistakes. There are tools and special ways to use C that can help make the code safer and easier to keep up with.

Related languages

Main article: List of C-family programming languages

TIOBE index

Many programming languages came after C and were influenced by it. Languages like C++, C#, JavaScript, Python, and Ruby borrowed ideas from C, especially how they structure statements and expressions.

When object-oriented programming became popular, languages like C++ and Objective-C built on C to add new features. C++ was created by adding object-oriented tools to C while keeping much of its original style. Objective-C also added object-oriented features to C, mixing C’s syntax with ideas from another language called Smalltalk.

This article is a child-friendly adaptation of the Wikipedia article on C (programming language), available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.