C is a compiled, procedural programming language created by Dennis Ritchie at Bell Labs in the early 1970s. It offers direct access to memory through pointers and maps closely to machine instructions, while still being portable across processors.
Why it matters
Operating system kernels, embedded firmware, databases and language runtimes are largely written in C. Its small feature set, predictable performance and minimal runtime make it the common denominator that other languages use to talk to the system. The cost of that control is responsibility: there is no garbage collector and no bounds checking, so memory bugs such as buffer overflows are a major source of security vulnerabilities.
Example
#include <stdio.h>
int main(void) {
int n = 42;
int *p = &n;
printf("%d\n", *p);
return 0;
}
p holds the address of n, and *p reads the value stored there. The program prints 42.
Common mistakes
- Using a pointer after the memory it refers to was freed.
- Forgetting the terminating null byte on strings, or copying into a buffer that is too small.
- Assuming
inthas the same size on every platform.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.