Skip to main content

C

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/c-language

In short

C is a compiled, low-level programming language that gives direct control over memory and is used to build operating systems, drivers, and embedded software.

What is the C programming language?

C is a general-purpose programming language created by Dennis Ritchie at Bell Labs in the early 1970s, originally to write the Unix operating system. It is small, fast, and close to the hardware: C code maps fairly directly onto machine instructions, which is why it is sometimes called a "portable assembly language." The language is standardized by ISO, and the latest standard is C23.

C is statically typed, but it trusts the programmer: values can be converted between types implicitly, and pointers (variables that hold memory addresses) can be cast freely. Memory is managed manually. Local variables live on the stack and disappear when a function returns, while longer-lived data is requested from the heap with malloc and must be handed back with free. There is no garbage collector and no bounds checking on arrays, so mistakes can cause memory leaks, crashes, or security holes such as buffer overflows.

C is used for operating system kernels such as Linux, embedded firmware in microcontrollers, device drivers, databases, and the interpreters of other languages, including CPython. Because almost every language can call C functions, C also acts as a common meeting point between languages. Writing C is a bit like driving a manual car with no driver assistance: you control everything, but every gear change is your responsibility.

C is often lumped together with C++, but they are different languages. C++ began as an extension of C and can compile most C code, yet it adds classes, templates, exceptions, and a much larger standard library. C stays deliberately minimal: it has no classes, no exceptions, and no built-in string type, since strings are simply arrays of characters ending with a zero byte.

Key takeaways

  • C compiles directly to machine code, which makes it fast and predictable.
  • Memory is managed manually with functions like malloc and free.
  • It has no classes, exceptions, or garbage collector.
  • Operating system kernels, embedded firmware, and many language runtimes are written in C.

Example

Allocating and freeing memory by handc
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    // Ask the heap for space for 5 integers
    int *numbers = malloc(5 * sizeof(int));
    if (numbers == NULL) return 1;

    for (int i = 0; i < 5; i++) numbers[i] = i * i;
    printf("Last square: %d\n", numbers[4]);

    free(numbers); // C never frees memory for you
    return 0;
}

Readers ask

Is C still used today?

Yes. C is still a core language for operating systems, embedded devices, and performance-critical libraries, and many higher-level languages rely on components written in C.

What is the difference between C and C++?

C++ grew out of C and adds features such as classes, templates, exceptions, and a large standard library. C is smaller and simpler, and is often chosen where minimal runtime overhead and easy portability matter most.

Why is C considered unsafe?

C does not check array bounds or track memory for you, so bugs like reading past the end of a buffer or using memory after freeing it can crash a program or create security holes. Careful coding, sanitizer tools, and code review help reduce these risks.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings