Beginner · Getting started with C · topic 1 of 60 · 20 min
What C is and why it still matters
Explanation
A language close to the machine
C was created around 1972 by Dennis Ritchie at Bell Labs to write the Unix operating system. It is called a "low-level" or "systems" language: it is close to how the processor actually works. You manage memory yourself, you can work with addresses and individual bits, and there is almost nothing hidden between your code and the machine. In return, C programs are small and very fast.
Where C runs today
- Operating systems: the Linux kernel, large parts of Windows and macOS, and Android's lower layers.
- Databases and tools: SQLite (on almost every phone), Redis, Git, and the main Python interpreter (CPython) are written in C.
- Embedded systems: microcontrollers in washing machines, cars (engine control units), medical devices, smart meters, routers and satellites.
- Libraries used by other languages: image, audio, compression and cryptography libraries that Python, Java and JavaScript call underneath.
Compiled, not interpreted
A compiler translates your whole C program into machine code for a specific processor and operating system, producing an executable file. Python and JavaScript are usually run by an interpreter or a runtime that reads the code while it runs. Compiled C needs no runtime and starts instantly, but you must compile again for each platform.
hello.c --(gcc)--> hello (Linux/macOS) or hello.exe (Windows) --> runs directly on the CPUC and C++
C++ started as "C with classes" and grew into a much larger language with objects, templates and a big standard library. Most C code is close to valid C++, but they are different languages with different rules. Learning C first gives a clear base for C++, Rust, embedded work and understanding operating systems.
Standards
| Standard | Year | Notable additions |
|---|---|---|
| C89 / C90 (ANSI C) | 1989–90 | The first standard |
| C99 | 1999 | // comments, long long, <stdbool.h>, <stdint.h>, declaring variables anywhere |
| C11 | 2011 | Threads, atomics, _Static_assert; gets() removed |
| C17 | 2018 | Bug fixes only |
| C23 | 2024 (ISO/IEC 9899:2024) | bool/true/false as keywords, nullptr, typeof, binary literals 0b1010 |
This course uses C17 in examples (gcc -std=c17) because it is supported everywhere, and points out C23 changes where they matter. Newer GCC versions (15 and later) use C23 by default; check yours with gcc --version.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
What C is and why it still matters · 1/6
Welcome to C Programming. First, let us see what C is and why it still matters.
Prefer a video by a teacher? Find free videos on “what is c programming language history why learn c” on YouTube ↗
In real life: C inside your phone
Every time a UPI app on an Android phone stores your recent transactions offline, it very likely uses SQLite, a database engine written in C. The app itself may be written in Kotlin, but the code that actually reads and writes the database file is compiled C, chosen because it is small, fast and reliable.
#include <stdio.h>
int main(void) {
printf("C runs inside databases, kernels and devices.\n");
return 0;
}Practice (0/3 done)
Which of these is mostly written in C?
What does a C compiler produce?
List five devices or programs you used this week that very likely contain C code (for example your phone's operating system, a Wi-Fi router, a car, a bank ATM, a database). For each, write one sentence on why C suits it.
Quick quiz
Read more (free)
Related help
Related topics
- Compiling with gccGetting started with C · same module
- The structure of a C programGetting started with C · same module
- Data types and their sizesGetting started with C · same module
- What C++ is and how compiling worksC++ Programming (modern C++ and DSA) · First steps: compiling, output, variables and input
- What Java is and where it is usedJava Programming (Core to Spring Boot) · Getting started with Java
- What Rust is and why learn itRust Programming · Getting started with Rust
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Who created C?
Answer: Dennis Ritchie
Ritchie created C at Bell Labs.
Which standard removed gets()?
Answer: C11
gets() was removed in C11 because it cannot be used safely.
In C23, which became keywords?
Answer: bool, true and false
Before C23 they came from <stdbool.h>.
What is "undefined behaviour"?
Answer: Code whose result the C standard does not define, so anything can happen
Crashes, garbage or silent bugs.
What does a C++ compiler produce from your source code?Related
Answer: Machine code in an executable file
The compiler translates C++ into machine code, saved as a program you can run directly.
What does the JIT compiler do?Related
Answer: Compiles frequently used bytecode to native machine code at run time
JIT makes long-running Java programs fast.
How does Rust free memory?Related
Answer: Through ownership: a value is freed when its owner goes out of scope
Ownership rules make freeing automatic and predictable, and the compiler checks them.
What does arm-none-eabi-gcc do?Related
Answer: Cross-compiles C for bare-metal ARM microcontrollers
Compiling for a different target.
From Embedded C basics
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 4 more topics in “Getting started with C” before its exam: Compiling with gcc, The structure of a C program, Data types and their sizes, Input and output: printf and scanf.
- Module 1 exam: Getting started with C · 12 questions · 20 min, without help. 5 topics of this module still to finish first.
- Then the next module, Operators and control flow. 60 topics left in the course before the final exam.