The C Programming Language: Comprehensive Guide
The C programming language is one of the most popular and widely used in the IT industry.
Created in the 1970s by Dennis Ritchie, it has been used to build operating systems such as Windows and Linux, desktop applications, system software, drivers, and firmware.
The C language was designed to be portable, efficient, and flexible. It is a low-level language that allows direct access to computer memory, but also a high-level language that enables writing complex programs.
In this comprehensive guide to the C language, we will learn how to program in C from the basics to more advanced concepts.
The following table summarizes the main features of the C language:
| Feature | Description |
|---|---|
| First version year | 1972 |
| Programming paradigm | Imperative, Procedural, Structured |
| Designed by | Dennis Ritchie |
| Typing | Static, Manifest, Nominal, Weak |
| Compilation | Compiled |
| Memory management | Manual |
| Platform | Cross-platform |
| Standard | C89, C99, C11, C17, C23 |
| File extension | .c, .h |
The following table lists the main C language compilers:
| Compiler | Description |
|---|---|
| GCC | Most widely used open-source C and C++ compiler |
| Clang | Open-source C and C++ compiler |
| Visual Studio | Microsoft's C and C++ compiler |
| Intel C++ Compiler | Intel's C and C++ compiler |
| C++Builder | C and C++ compiler by Embarcadero (formerly Borland) |
Conditional Statements
Iteration Statements
Functions and Scope
- Introduction to Functions
- Defining Functions
- Invoking Functions
- Function Declarations
- Functions and Arguments
- Arrays as Function Arguments
- Functions and Return Values
- Functions with a Variable Number of Arguments
- Local Variables
- Global Variables
- Code Blocks
- Variables Visibility or Scope
- Pure and Impure Functions and Side Effects
- Function Call Stack
- Recursive Functions
Structures, Unions and Enumerations
Pointers: Advanced Concepts
- Dynamic Memory Allocation
- Dynamic String allocation
- Dynamic Array allocation
- Dynamic Memory Access Functions: Under construction
- Pointers to Pointers
- Dynamic String Arrays: Under construction
- Function Pointers
- Function Pointers as Function Arguments
- Restricted Pointers
- Flexible Array Members in C99
Low-Level Programming
Input and Output
- Introduction to Input/Output and Streams
- Text Files and Binary Files
- Opening a File
- Closing a File
- Passing File Names as Command Line Arguments
- Temporary Files
- Files and Buffering
- Deleting or Renaming a File
- Formatted Input and Output
- Detecting End of File and I/O Errors
- Character Input and Output
- Line Input and Output
- Binary Input and Output
- File Positioning
- String Input and Output
- Format Specifiers for Output
- Format Specifiers for Input
Error Handling and Diagnostics
Mathematical Features
- Determining the Characteristics of Floating Point Numbers
- Determining the Characteristics of Integers
- The Standard Mathematical Library
- The Mathematical Execution Environment: Floating Point Environment
- Standard Library Mathematical Functions
- Rounding and Remainder Mathematical Functions
- Comparison Functions for Floating Point Numbers
- Classification and Manipulation Functions for Floating Point Numbers