Skip to content

Beginner · Getting started with C · topic 1 of 60 · 20 min

What C is and why it still matters

Explanation

C is a small, fast, compiled language created by Dennis Ritchie at Bell Labs in the early 1970s. It gives direct control over memory and hardware, which is why operating systems, databases, language interpreters and embedded devices are written in it. Learning C teaches you how computers really work underneath every other language.

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.

output
hello.c  --(gcc)-->  hello (Linux/macOS) or hello.exe (Windows)  --> runs directly on the CPU
One source file, compiled into a native executable.

C 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

StandardYearNotable additions
C89 / C90 (ANSI C)1989–90The first standard
C991999// comments, long long, <stdbool.h>, <stdint.h>, declaring variables anywhere
C112011Threads, atomics, _Static_assert; gets() removed
C172018Bug fixes only
C232024 (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.

Careful: C trusts the programmer completely. Reading past the end of an array, using memory after freeing it, or overflowing a signed integer is "undefined behaviour": the program may crash, print garbage, or seem to work and fail later. Many famous security bugs come from this. Throughout the course you will learn the habits and tools that prevent it.
Think of it like this: If Python is an automatic car with airbags and lane assist, C is a manual sports car with no driver aids: faster, more control, and you can feel the engine, but every mistake is yours. Learning to drive it makes you a better driver of every other car.
Tip: You do not need to become an expert in hardware to learn C. Start with the basics here; the "how memory really works" understanding comes step by step with pointers (module 5).

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

What is C?

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.

c
#include <stdio.h>

int main(void) {
    printf("C runs inside databases, kernels and devices.\n");
    return 0;
}
A complete C program: prints one line.

Practice (0/3 done)

Task 1 · Question

Which of these is mostly written in C?

Task 2 · Question

What does a C compiler produce?

Task 3 · Practice

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

Question 1

1.Who created C?

Question 2

2.Which standard removed gets()?

Question 3

3.In C23, which became keywords?

Question 4

4.What is "undefined behaviour"?

Read more (free)

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.

From What C++ is and how compiling works

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.

From What Java is and where it is used

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.

From What Rust is and why learn it

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

  1. 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.
  2. Module 1 exam: Getting started with C · 12 questions · 20 min, without help. 5 topics of this module still to finish first.
  3. Then the next module, Operators and control flow. 60 topics left in the course before the final exam.