1. What Is C
C is a general-purpose programming language created in 1972 for the UNIX operating system. The OS itself and most of its bundled software are written in C. However, it is not locked to UNIX and can run on any computer or system. Often referred to as a “systems programming language”, it can be used to build operating systems and compilers, as well as all kinds of regular software.
C evolved from the B language, which was derived from BCPL. Both B and BCPL are typeless languages, while C introduced a complete system of data types.
2. Core Features
1) Rich Data Types
Compared to its predecessor B, C comes with an extensive set of data types.
Basic types: characters, integers of multiple sizes, floating-point numbers (decimals)
Derived types: pointers, arrays, structures, and unions. Pointers allow direct manipulation of memory addresses, independent of hardware architectures.
Rules: Operators can be combined to form expressions. Expressions such as assignments and function calls can stand alone as complete program statements.
2) Full Program Flow Control
It supports conditional branching (if-else), multi-way selection (switch), two types of loops (while/for that check conditions before execution, and do which checks conditions after execution), and early loop termination (break), among others. These flow control statements enable rich and complex program logic.
3) Functions
A function is a packaged set of fixed operational steps. You give it a name, and whenever you call that name, it runs all its built-in steps automatically.
Here’s a real-life analogy:
Suppose “bake bread” is a function.
You don’t have to repeat the whole process every time you want bread: knead dough → shape loaves → bake in the oven.
Just say “bake bread”, and the full process runs automatically — this action is called calling a function.
If you want to bake bread twice, you simply call the “bake bread” function two times.
Translating this concept to C:
The
printffunction wraps all the logic required to display text on screen. You only need to writeprintf("Hello")instead of manually controlling the computer display step-by-step.
Functions can return values of all kinds: integers, structs, pointers, and more.
It supports recursive calls (a function calling itself). Local variables inside functions are recreated every time the function runs; functions cannot be nested inside other functions, but variables can be declared inside separate code blocks.
Project source code can be split across multiple .c files for separate compilation.
Variables fall into three scopes: local to a single function, global only within one source file, or visible across the entire program.
4) Preprocessor
Before compilation runs, the preprocessor executes preliminary tasks: bulk macro text replacement, importing external source files, and conditional compilation of selected code segments.
The preprocessor handles commands that are not part of the core C language syntax before actual compilation. These extra tools exist to streamline development and boost efficiency, primarily through macros. We will cover this in depth in later chapters.
3. A Minimal Low-Level Language
“Low-level” here carries no negative connotation. C only manipulates native computer primitives: characters, numeric values, and memory addresses, leveraging arithmetic logic built directly into hardware for exceptional runtime performance.
In other words, it can interact with deeper computer internals. Compared to many other languages, C grants direct access to memory addresses and even hardware peripherals.
Minimal Native Features; Complex Capabilities Implemented via Libraries
C does not ship with native built-in support for strings, arrays, collections, file I/O, or input/output operations:
You cannot manipulate an entire string or array as a single unit; only structures support full-value copying.
There is no automatic memory management or garbage collection — memory must be manually allocated and freed by the developer.
No built-in read/write keywords exist; printing text or reading keyboard input is entirely handled by calling library functions.
It only provides basic single-threaded execution flow, with no native support for multitasking, parallel operations, synchronization, or coroutines.
A library is simply a collection of pre-written functions coded in C or other languages. Developers can invoke these ready-made functions to implement features without rebuilding core functionality from scratch.
While many features require manual library calls, the language itself is compact with a small rule set, making it easy to learn and fully master.
4. Standardization of C: ANSI C (1988)
Standardization became necessary as C grew widely adopted: countless developers and vendors implemented their own custom variations of the language, creating inconsistent syntax and behavior across platforms. A dedicated standards body was formed to create universal, unified rules — similar to how global standards regulate USB ports or electrical wall sockets.
ANSI = American National Standards Institute
Breakdown
The American National Standards Institute is a private U.S. standards organization. It does not produce software or write source code, but creates uniform specifications across industries including manufacturing, electronics, computing, and programming languages.
What Is ANSI C?
In 1983, ANSI assembled a committee to standardize C language syntax. The first official language specification, released in late 1988, is known as ANSI C (also referred to as C89).
5. ANSI Standard Companion: The Standard Library
The standard introduced a universal standard library that provides cross-platform utilities for file access, formatted input/output, memory allocation, string manipulation, and more, accessed through standardized header files.
The core C language syntax is intentionally minimal, only covering primitives like variables, conditionals, loops, functions, and pointers. It has no native built-in functionality for printing text, reading keyboard input, file operations, mathematical calculations, or string handling.
The ANSI C specification defines a universal collection of utility functions compatible with all compilers across all operating systems — this set of tools is called the Standard Library.
To access library functions, developers import header files using the syntax #include filename.h.
Examples:
#include <stdio.h> // Input/output library: printf (print text), scanf (read user input)
#include <stdlib.h> // Memory allocation, program exit, random number generation
#include <string.h> // String copy and comparison functions
#include <math.h> // Mathematical functions like sin() and sqrt()Code language: PHP (php)
Before the ANSI standard, print functions worked differently on UNIX versus Windows, causing code failures when ported between operating systems. After the standard library was established, code like printf("hello") runs identically on Windows, Linux, and macOS with zero modifications. This drastically reduced developer workload and accelerated the global adoption of C.
What Languages Power the Standard Library?
The majority of library functionality is implemented in C, with a small subset relying on assembly and other low-level languages.
Pure C handles functions that do not directly interface with hardware or operating systems, such as the string copy function strcpy, mathematical operations, and memory buffer copying.
Operations that interact directly with hardware or the operating system kernel cannot be implemented with C alone, and require supplementary low-level languages — most commonly assembly.
6. Portability and Type Safety
The same source code can be compiled and executed on different operating systems with minimal or zero edits required.
After reading this overview, you should have a foundational understanding of C. If some concepts remain unclear, do not worry — abstract text alone can be difficult to absorb. We will break down each topic with practical code examples in later chapters to solidify these ideas.