{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "language-reference",
  "slug": "languages/c",
  "name": "C",
  "section": "Languages",
  "canonical_definition": "C is a general-purpose, procedural, statically typed, compiled programming language that compiles to native machine code, provides manual memory management via malloc/free, direct memory access through pointers, and no runtime overhead \u2014 the foundational systems programming language of operating systems, kernels, compilers, and embedded systems.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "url": "https://thecodex.expert/coding/languages/c/",
  "current_standard": "C17 (ISO/IEC 9899:2018)",
  "newest_standard": "C23 (published 2024)",
  "created": "1969-1973",
  "creator": "Dennis Ritchie (Bell Labs)",
  "typing": "static, weak",
  "execution": "native compiled (no VM, no interpreter)",
  "memory_management": "manual \u2014 malloc/free; no GC",
  "paradigm": "procedural",
  "primary_use_cases": [
    "operating systems (Linux, macOS XNU, Windows NT)",
    "embedded systems",
    "compilers (GCC, Clang)",
    "database engines (SQLite, PostgreSQL internals)",
    "interpreters (CPython, Ruby MRI)"
  ],
  "critical_notes": {
    "undefined_behaviour": "Signed int overflow, null dereference, OOB access, use-after-free, data races are all UB \u2014 compilers may optimise them away, creating security holes",
    "array_decay": "Arrays decay to pointer in most contexts; sizeof(arr) gives total bytes only in declaring scope",
    "no_string_type": "Strings are null-terminated char arrays; buffer overflows are the most common C vulnerability",
    "c_vs_cpp": "C and C++ are different languages \u2014 not all C is valid C++",
    "type_sizes": "int/long sizes are platform-defined; use <stdint.h> (int32_t, int64_t) for portability"
  },
  "standard_versions": {
    "C89/C90": "ANSI C \u2014 original standard",
    "C99": "inline, mixed declarations, VLAs, stdint.h, stdbool.h, designated initialisers",
    "C11": "_Generic, _Static_assert, atomic ops (stdatomic.h), threads.h",
    "C17": "defect fixes only \u2014 no new features",
    "C23": "nullptr, binary literals (0b...), #embed, typeof, constexpr, improved attributes"
  },
  "sources": [
    {
      "num": 1,
      "citation": "ISO/IEC 9899:2018. C17 \u2014 Programming languages \u2014 C. iso.org/standard/74528.html.",
      "tier": 1
    },
    {
      "num": 2,
      "citation": "Kernighan, B. W. & Ritchie, D. M. (1988). The C Programming Language (2nd ed.). Prentice Hall.",
      "tier": 1
    },
    {
      "num": 3,
      "citation": "Seacord, R. C. (2013). Secure Coding in C and C++ (2nd ed.). Addison-Wesley.",
      "tier": 1
    },
    {
      "num": 4,
      "citation": "Open Standards. C23 working draft N3220. open-std.org/JTC1/SC22/WG14/.",
      "tier": 1
    },
    {
      "num": 5,
      "citation": "LLVM Project. Clang documentation: AddressSanitizer, UBSan. clang.llvm.org/docs/.",
      "tier": 1
    }
  ]
}