Skip to content
  • Introduction to C · C

Introduction to C

LearnViaNotes @learnvianotes· 2 min read

A small, fast, portable systems language — the language of operating systems, embedded devices, databases and the runtimes of most other languages.

A short history

YearMilestone
1972Dennis Ritchie creates C at Bell Labs (successor of B) to rewrite UNIX.
1978The C Programming Language (K&R) by Kernighan & Ritchie — the de-facto standard, “K&R C”.
1989 / 1990C89 / C90 — the first ANSI / ISO standard (“ANSI C”). Function prototypes, void, const.
1999C99 — // comments, long long, <stdint.h>, bool, VLAs, designated initializers, inline, mixed declarations.
2011C11 — _Generic, _Static_assert, anonymous structs/unions, <threads.h>, <stdatomic.h>, _Alignas; gets removed.
2018C17 (C18) — bug-fix release of C11, no new features. The default standard for these notes.
2024C23 — bool/true/false as keywords, nullptr, constexpr, typeof, #embed, binary literals 0b1010, [[attributes]].

Why learn C?

The trade-off

C gives youC does NOT give you
Raw pointers and manual memory controlGarbage collection, bounds checks, null safety
Structs, unions, functionsClasses, inheritance, templates, exceptions
A tiny standard libraryBuilt-in strings, lists, maps, networking
Speed and controlProtection from undefined behaviour — mistakes compile and silently misbehave

Hello, world

C
#include <stdio.h>

int main(void) {
    printf("Hello, world!\n");
    return 0;
}
Output
Hello, world!
Terminal
$ gcc hello.c -o hello        # compile (or: clang hello.c -o hello)
$ ./hello                     # run
Hello, world!
$ echo $?                     # exit status returned by main
0

Is C a high-level or low-level language?

What is the difference between C and C++?

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report